vision-camera-code-scanner icon indicating copy to clipboard operation
vision-camera-code-scanner copied to clipboard

Warning: Can't perform a React state update on an unmounted component.

Open moo611 opened this issue 2 years ago • 2 comments

Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function. in Scanner (at SceneView.tsx:132)

moo611 avatar Jul 26 '23 04:07 moo611

As stated in the warning message did you remove all listener in a useEffect hook or in the componentWillUnmount function? This errer usually happen when you have a setTimeout or a fetch/axios call to a remote resource and the response arrives after your component is unmounted.

lpfrenette avatar Jul 31 '23 12:07 lpfrenette

https://dev.to/collegewap/react-prevent-state-updates-on-unmounted-components-2j4d

taongocson avatar Oct 06 '23 06:10 taongocson