react-native-sensor-fusion icon indicating copy to clipboard operation
react-native-sensor-fusion copied to clipboard

Error when the component unmounts

Open ghirihari opened this issue 4 years ago • 1 comments

TypeError: undefined is not an object (evaluating 'this.closed')

This error occurs When the component is gets unmounted, To be more specific. The error is from the Rxjs package. In Node_modules/rxjs/internal/Subscriber.js. the variable "this" is undefined. This causes the problem. I don't know hiw to fix it. Hoping for a fix soon, Thanks

ghirihari avatar Nov 18 '20 18:11 ghirihari

I am also seeing this issue.

In my /node_modules/react-native-sensor-fusion/index.js useEffect( . . . const subscriptions = types . . . map(... }})); return () => subscriptions .map(({ unsubscribe }) => unsubscribe());

I commented out the whole return () => part, so the last two lines, and it no longer crash, confirming that that area is the source of the issues.

However, this is a hack, as it results in the 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."

ChiaHuaLu avatar Feb 05 '21 22:02 ChiaHuaLu