Open zakpucci opened 1 year ago
Hi @zakpucci, thanks for open the Issue.
Sound weird. Mind creating a minimal reproduction in a sandbox in order to allow others to debug your use-case and try to find a solution? Thanks!
I've run into this. You have your react in strict mode, which means all useEffects are run, then cleanup, then run again (basically a mount/remount). This is to ensure your side effects are clean. There is no way to disable it for portions of your application, so you will have to remove it entirely.
Just ran into this. Would it be worth it to implement beforeClose
differently?
Maybe add some behavior to setIsOpen(false)
? The mounting of <Tour>
is dependant on isOpen
after all.
The only problem I see there is if the whole TourProvider
is unmounted.
My assumption would be that the
beforeClose
event on theTourProvider
would fire on mousedown on the close button. I'm seeing this event fire on mount if I call setIsOpen. Any know issues here? Am I missing something?