How can i insert a react component as a node

We’ve actually written something similar, but we’re having trouble with giving the react components rendered from within each node view access to the context being provided from the app root. Looking at react dev tools, it looks like it’s because each time we call ReactDOM.render, react creates a separate tree. Looking at the example linked above, I’d imagine it has the same issue.

Also, its use of ReactDOM.createPortal doesn’t seem to work, both based on the comment and my own testing. ReactDOM.createPortal returns a renderable, so it still needs to be rendered into the react tree, which I don’t think is happening.

@jhnsnc I’m interested in how you guys are doing it. I did look through the ReactNodeView class you mentioned, and I see that you guys are using unstable_renderSubtreeIntoContainer, which seems to allow for a context to be provided. If I’m not mistaken, that function has been deprecated, so I’m wondering how you guys eventually plan to switch over to ReactDOM.createPortal. I couldn’t find a good way to provide context to a portal aside from rendering it as a child of provider.