react-reverse-portal icon indicating copy to clipboard operation
react-reverse-portal copied to clipboard

Nextjs error

Open fred-boink opened this issue 4 years ago • 1 comments

Has anyone tried to run this on Nextjs? Getting an error:

"Cannot read property 'getInitialPortalProps' of null"

fred-boink avatar Oct 07 '21 02:10 fred-boink

As far as I know everything should work fine with Nextjs, or any other React framework. One thing that might be tricky though is if Nextjs automatically tries to render your portals with SSR. Because portals interact with the DOM directly, lots of SSR setups might not work, so for now it's generally recommended to avoid rendering portals on the server-side entirely.

https://github.com/httptoolkit/react-reverse-portal/issues/3 has a little more context if that's useful. Do you think that might be the issue here?

pimterry avatar Oct 07 '21 10:10 pimterry