react-native-sensor-fusion
react-native-sensor-fusion copied to clipboard
Error when the component unmounts
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
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."