Hello !
The title sums up most of my understanding of the problem.
I tried to make a small stackblitz to show it. (try to toggle on then off quickly and it will crash)
https://stackblitz.com/edit/react-ts-wj ... =index.tsx
It took me several hours to isolate the issue and I hope it is not due to a misuse of the library.
Have a good day,
Alexis G.