colorfy-software / react-native-modalfy

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

There was no opened 'ModalName' modal warn #102

Closed easyscripter closed 1 year ago

easyscripter commented 1 year ago

Hi , i have a warn when try close one modal and open another modal.

I have two modals: ChooseGymModal and Confirm Modal

Code: App.tsx `const modalConfig: ModalStackConfig = {ChooseGymModal, ConfirmModal}; const defaultOptions: ModalOptions = {backdropOpacity: 0.6}; const stack = createModalStack(modalConfig, defaultOptions); return (

); `

code handler for ChooseGymModal: const {openModal, currentModal} = useModal(); const handleCancelModal = useCallback(() => { closeModal(currentModal, () => { openModal('ConfirmModal', { title: 'Вы точно хотите отменить выбор зала?', message: 'Будет выбран зал по умолчанию', }); }); }, []); and when i click on cancel button who has this handler i have a warning that cyclically appears in the console

easyscripter commented 1 year ago

this problem was solved.