microsoft / microsoft/AdaptiveCards
[Rendering] React Wrapper hostConfig is not optional
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 2k
- Forks
- 595
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 1
Description
Target Platforms
NodeJS
SDK Version
1.3
Application Name
React
Problem Description
If you use adpativecards-react wrapper, documentation and code both do not specify hostConfig as required. But if you leave out hostConfig the Card is not rendered, just an empty <div /> appears.
This behaviour only appears with adaptivecards-react@1.1.1 - it was working with adaptivecards-react@1.0.0
Screenshots
No response
Card JSON
{
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"wrap": true,
"spacing": "medium",
"separator": true,
"text": "hello"
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.3"
}
Sample Code Language
React
Sample Code
import { AdaptiveCard } from "adaptivecards-react";
import React from "react";
const ChatMessage = () => {
return (
<AdaptiveCard
payload={{
$schema: "https://adaptivecards.io/schemas/adaptive-card.json",
type: "AdaptiveCard",
version: "1.3",
body: [
{
type: "TextBlock",
text: "hello",
wrap: true,
spacing: "Medium",
separator: true,
},
],
}}
/* hostConfig is needed - remove it, and the card won't show "hello" */
hostConfig={{}}
/>
);
};
export { ChatMessage };
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the supplied React example with adaptivecards-react 1.1.1, comparing it with 1.0.0, then inspect the adaptivecards-react wrapper entry point and its documentation. Done means the hostConfig requirement and the wrapper's rendering behavior are consistent and covered by an appropriate verification.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100