We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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)
My code
const getChatDispObserve = cid => { try { console.log('get data', cid); // const chatColl = database // .get(CHAT_COLL) // .query(Q.where('cid', cid), Q.experimentalSortBy('created_at', Q.desc)); const chatColl = database .get(CHAT_COLL) .query(Q.where('cid', cid)); const observable = chatColl.observeWithColumns(['sent_st']); return observable; } catch (e) { console.error('GetChatDispObserve', e); } }; const enhance = withObservables(['item'], (props) => { const chatList = GetChatDispObserve(props.item.cid); return { chatList }; }); const EnChatComp = enhance(ChatComp);
The text was updated successfully, but these errors were encountered:
I think the issue is in the ChatComp component, not in the un subscription. Observables are unsubscribed on component unmount.
ChatComp
Sorry, something went wrong.
No branches or pull requests
Is there any anyway to unsubscribe observable when component unmount.
i am getting below error, when component unmount
My code
The text was updated successfully, but these errors were encountered: