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

Support for React Native

Open dylancom opened this issue 5 years ago • 5 comments

I was wondering if it would be possible to use reversed portals in a React Native project.

dylancom avatar Mar 11 '20 19:03 dylancom

Right now, no, this isn't supported. I'd love to be able to support it, but I'm not sure it's even possible.

At the moment, react-reverse-portals works by rendering into a custom dom node using a normal react portal, and then moving that node around to get the behaviour we want. Moving nodes could be replaced by some specific react native mechanism, maybe, but as far as I can tell react native doesn't support standard portals at all, so that wouldn't be sufficient. I suspect until it does, it's just not practical to support react native here.

Sorry about that. If you do find a way that this could work though, I would love to hear about it!

pimterry avatar Mar 11 '20 20:03 pimterry

It seems these guys came really far: https://tech.m6web.fr/6play/how-a-fullscreen-video-mode-ended-up-implementing-react-native-portals/ https://github.com/mfrachet/rn-native-portals Only not supported anymore for iOS.

dylancom avatar Mar 12 '20 07:03 dylancom

@pimterry with projects such as https://github.com/gorhom/react-native-portal, do you think that your opinion of March 2020 would change?

janvorwerk avatar Oct 31 '23 13:10 janvorwerk

No idea @janvorwerk, I haven't touched react-native myself at all. If you want to try out new approaches, go for it! Do please share any feedback about what works or doesn't here for others too.

pimterry avatar Oct 31 '23 13:10 pimterry

@pimterry thanks for your reply. I wish I was more experienced with both React and React Native, but it's a starting journey for me. Sure if I find something, I'll share it here!

janvorwerk avatar Oct 31 '23 13:10 janvorwerk