Is there any anyway to unsubscribe observable when component unmount.
i am getting below error, when component unmount
Warning: Internal React error: Attempted to capture a commit phase error inside a detached tree. This indicates a bug in React. Likely causes include deleting the same fiber more than once, committing an already-finished tree, or an inconsistent return pointer.
Error message:
TypeError: Cannot convert undefined or null to object
in ChatComp (created by withObservables[item] { chatList })
in withObservables[item] { chatList } (created by gestureHandlerRootHOC(withObservables[item]))
in RNGestureHandlerRootView (created by GestureHandlerRootView)
in GestureHandlerRootView (created by gestureHandlerRootHOC(withObservables[item]))
in gestureHandlerRootHOC(withObservables[item]) (created by WrappedComponent)
in WrappedComponent
in RCTView (created by View)
in View (created by AppContainer)
in RCTView (created by View)
in View (created by AppContainer)
in AppContainer
in Chat(RootComponent)
Is there any anyway to unsubscribe observable when component unmount.
i am getting below error, when component unmount
My code