react-reverse-portal
react-reverse-portal copied to clipboard
Since updating to Immer 10.1.2 react-reverse-portal no longer works
A recent version of Immer has implemented this change:
https://github.com/immerjs/immer/pull/1069
Since then, my component is throwing this error when mounting InPortal:
Renderable.tsx:24 TypeError: Cannot assign to read only property 'setPortalProps' of object '#<Object>'
at Object.assign (<anonymous>)
at InPortal2._this.addPropsChannel (react-reverse-portal.js?v=4b696a38:114:16)
at InPortal2.componentDidMount (react-reverse-portal.js?v=4b696a38:126:12)
I don't know much about Immer I'm afraid. Open to suggestions or PRs on ways to improve compatibility with this, but react-reverse-portal does need to track & mutate internal state shared between various different components outside of the normal pure React props/state flow. Somehow the in portal needs to transparently pass data up through the node, and back down to the out portal.
Thanks @pimterry - I have added an issue in Immer in case someone cleverer than me can offer some advice.