-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
This library appears to have conflicts with mobx-react.
Here is the thread where I discovered the issue, along with analysis of the cause: mobxjs/mobx-react#797
Summary: Because react-class-hooks replaces this.render after mobx-react has already created a reaction object (attached to the original render function), whenever MobX detects a change, it only calls the original render function -- not the wrapper that react-class-hooks added late (onto the instance).
What problems does it cause?
- It causes mobx-react to never clean up the reaction, causing a memory leak and potential drop in performance (from the reaction continuing to update, even past the component's unmounting).
- It likely causes react-class-hooks to not store/retrieve its data properly when re-renders are triggered by MobX. This is because the
this.renderoverride by react-class-hooks would not be called, meaning the stack counter would not be reset, leading to it just keeping on adding more cells instead of reading from existing ones.
Metadata
Metadata
Assignees
Labels
No labels