colorfy-software / react-native-modalfy

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

CloseModals not updating the currentModal value #5

Closed jxshco closed 4 years ago

jxshco commented 4 years ago

Say if I call openModal a few times e.g.

openModal('page1')

openModal('page2')

openModal('page3')

then use currentModal to then close the pages

closeModals(currentModal) //page 3 closes

closeModals(currentModal) //nothing happens

closeModals(currentModal) //nothing happens

This is because currentModal in the state is not being updated when calling closeModals. I've added a temp fix for my use-case at the minute over here: https://github.com/jxshco/react-native-modalfy as an example.

CharlesMangwa commented 4 years ago

Hi @jxshco! Thanks for the heads up and sorry for the delay: bug fixed for both closeModals() and closeModal() in 71425aea7addae79d08c5f6103951a32c80a5a1a. Please test it in react-native-modalfy@1.0.1 and feel free to re-open this issue if needed!

jxshco commented 4 years ago

Works perfectly, thanks @CharlesMangwa