colorfy-software / react-native-modalfy

🥞 Modal citizen of React Native.
https://colorfy-software.gitbook.io/react-native-modalfy
MIT License
1.16k stars 48 forks source link

backBehavior "none" only for one Modal #87

Closed DWboutin closed 2 years ago

DWboutin commented 2 years ago

Hi Guys!

Thanks for this nice lib, very easy and it got smooth animations.

I would love to have mandatory modals, but the backBehavior config is set to all Modals that I'll define with createModalStack(modalConfig, defaultOptions).

Is there any way to set this to only one modal?

Thank you

CharlesMangwa commented 2 years ago

Hi @DWboutin! Yes, that's possible! As mentioned in this section of documentation:

There are 3 ways to provide options to a modal:

  1. Trough defaultOptions in createModalStack() as we just did
  2. Inside modalConfig by providing a modalOptions object instead of just the component directly
  3. Inside the modal component file itself, via static modalOptions (Class) or MyModalComponent.modalOptions (Hooks)

So it's up to you to pick up between option 2 and 3 which one you prefer to set backBehavior from 👍

DWboutin commented 2 years ago

Great! Tyvm