Too easy to create infinite loops
maddie927 opened this issue · 0 comments
maddie927 commented
Due to React using shallow reference equality, it's a bit too easy to cause infinite loops by putting something like a Maybe in your component state and rebuilding it in an unconditional setState inside receiveProps.
Possible fixes:
- just revert the 2.0.1 change,
findDOMNodewill be slightly risky if not used within asetStateThencallback but this is a bit of an edge case anyway - expire the slightly overloaded
receiveProps, using optional lifecycle hooks instead (bigger API change)- reason-react's approach might be worth considering
- something else I'm not thinking of?