JakeGinnivan / react-popout

React popout is a React component wrapping window.open allowing you to host content in a browser popup window.
MIT License
188 stars 59 forks source link

Component inside Popout cannot use findDomNode #23

Open mikemorton opened 8 years ago

mikemorton commented 8 years ago

I've got a couple components that are wrapping legacy non-react modules. These components rely on findDomNode to work correctly, however if they're rendered inside the Popout they break down. Using refs also breaks down in this context. Does anyone have any ideas to get around this?

rbardini commented 8 years ago

I'm also having invariant violations due to refs:

Uncaught Invariant Violation: addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component's render method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).

It was working before. I'm not sure if it started happening after upgrading React or the react-popout dependency.

EDIT: it looks like a react-popout@0.5.x regression, as I couldn't reproduce the issue with 0.4.0.

marchaos commented 7 years ago

Can you retest with the latest version? I suspect this might have something to do with ReactDOM.findDomNode using the parent window object. I doubt it is fixed in the latest version, but I can investigate if not.