Closed PsiKai closed 3 years ago
Hi, @PsiKai! I guess this is not a carousel issue because it doesn't have any state updates on destroying. Probably you didn't cleanup your components before destroy or it is somehow connected with routing . Also you can check examples additionally here.
Navigating away from the page with the carousel causes multiple errors to show in the console in development mode.
I'm using
react-rounter-dom
to switch between pages. When I navigate away from the carousel page, I get this error in the console:And after that periodically I will get 404 errors from an endpoint that I don't have setup:
I am using functional components with react hooks, so the
componentWillUnmount
lifecycle method is not available to me. I would add auseEffect
cleanup function to properly cancel the subscriptions like the error message indicates, but I don't know which subscriptions to cancel because I don't know what's happening "under the hood".Can you provide any insight on this? Is this a bug, or am I just doing something wrong? I didn't see any kind of unmount method in the NPM docs.
I will provide a code example, as that is standard, but it's a very simple application of the carousel, so I don't know if it'll be much help: