-
Notifications
You must be signed in to change notification settings - Fork 109
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
How to share React Context with Angular #113
Comments
Hey @raubel , this is possible but it requires a fork of react2angular. At my company, we already implemented this and it works fine. Here's the gist of it:
In the end, the bootstrapped react app will hold on its state all the render functions which setPortals on AngularJS Elements. It works fine and they all share the same context. |
I've created a library to resolve this: react2angular-shared-context It uses portals as suggested above but is not dependant on how react2angular works. |
More than three years after, I have the opportunity to come back to my problem and apply your solution. And it works like a charm! |
My React component relies on a React Context, using a Context Consumer.
Since my Angular app does not bootstrap any React component hierarchy, my Context Provider is not initialized.
Do you have any advice to have an initialized Context when my React component is rendered?
The text was updated successfully, but these errors were encountered: