Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JS] Add hostConfig to adaptivecards-react project #6577

Merged
merged 6 commits into from
Oct 19, 2021

Conversation

licanhua
Copy link
Contributor

@licanhua licanhua commented Oct 11, 2021

In #6145, adaptivecards-react is added, and which implemented HostConfigContext, but user has to implement its own Provider to customize the hostConfig.

In this PR, it allows react to pass hostConfig from props.
hostConfig takes high priority than customized host config Provider if both hostConfig and provider are used.

Fix #6504

Microsoft Reviewers: Open in CodeFlow

@ghost
Copy link

ghost commented Oct 11, 2021

Hi @licanhua. Thanks for helping make the AdaptiveCards JS renderer + tooling better. As additional verification, once the JS build succeeds, please go to the test site to test out your website/designer changes.

@marakim
Copy link
Contributor

marakim commented Oct 13, 2021

This change shouldn't be necessary as the host config is meant to be made available via the React context provider HostConfigContext. I could see it being convenient to be able to pass in a host config directly (perhaps as a component level override?). @paulcam206 what do you think?

@licanhua
Copy link
Contributor Author

onfig directly (

I would like to make adaptivecards-react very simple and it's just a wrapper of adaptivecards. For advanced feature, we can provide HOC, subclass or composition. For example: AdaptiveCardsWithContext

Copy link
Member

@paulcam206 paulcam206 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@licanhua licanhua merged commit b19a1bd into main Oct 19, 2021
@licanhua licanhua deleted the canhua/reactHostConfig branch October 19, 2021 20:50
michaelfarnsworth pushed a commit to michaelfarnsworth/AdaptiveCards that referenced this pull request Nov 10, 2022
* add hostConfig to props

* update readme

* Fix format
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] allows host config to pass from adaptivecards-react to adaptivecards
4 participants