gunnartorfis / sonner-native

An opinionated toast component for React Native. A port of @emilkowalski's sonner.
https://gunnartorfis.github.io/sonner-native
MIT License
459 stars 18 forks source link

Consider using react-native-z-view (for Android) #50

Closed gunnartorfis closed 2 months ago

gunnartorfis commented 2 months ago

I haven't tested Android very thoroughly, but it might run into some issues with being on top of everything in some cases. We should experiment with using react-native-z-view.

The only drawback is that this would require an extra native dependency and since react-native-z-view isn't widely used, it would mean a native update in order to use sonner-native. If we'd somehow make it optional, like checking if react-native-z-view is present in the consumer app, that'd be the best solution.

fobos531 commented 2 months ago

Also worth considering whether this library supports the new architecture.

hirbod commented 2 months ago

@fobos531 it does not support the new architecture yet, but Nishan will add support for it soon.

Elue-dev commented 2 months ago

I haven't tested Android very thoroughly, but it might run into some issues with being on top of everything in some cases. We should experiment with using react-native-z-view.

The only drawback is that this would require an extra native dependency and since react-native-z-view isn't widely used, it would mean a native update in order to use sonner-native. If we'd somehow make it optional, like checking if react-native-z-view is present in the consumer app, that'd be the best solution.

I can confirm that issues occur on android, check out the recording below

https://github.com/user-attachments/assets/4c1d4d55-3ce8-44f4-96f0-8f3bf73a9943

how do I work around this, with the react native z view suggested? how do I implement this please

gunnartorfis commented 2 months ago

@Elue-dev I've never used react-native-z-view myself but here's a Twitter discussion you might want to check out: https://twitter.com/hirbod_dev/status/1833059372622086398