seniv / react-native-notifier

Fast and simple in-app notifications for React Native
MIT License
1.05k stars 60 forks source link

Is there way to show notification when Modal is enabled ? #52

Closed Engazan closed 2 years ago

Engazan commented 2 years ago

Hi, is there any prop that helps me show Notification when "Modal" native component is Visible ?

Screenshot 2021-09-30 at 15 03 17

seniv commented 2 years ago

Hello @Engazan! I just checked how this one can be solved, and it looks like it's not possible to display any component above react-native's Modal. Also, looks like it's not possible to display two RN's Modal at the same time. ref 1: https://stackoverflow.com/questions/39766350/bring-view-on-top-of-modal-using-zindex-style-with-react-native ref 2: https://github.com/react-native-modal/react-native-modal#i-cant-show-multiple-modals-at-the-same-time

So the only way to display Notification above the Modal is to use react-native-modal instead of RN's Modal and pass coverScreen={false} param. This problem was discussed here: https://github.com/seniv/react-native-notifier/issues/19

Engazan commented 2 years ago

Yup, how i solved this is using custom modal component "react-native-bottom-sheet", with this it worked fine as expected :)