purescript-react/purescript-react-basic

Too easy to create infinite loops

maddie927 opened this issue · 0 comments

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, findDOMNode will be slightly risky if not used within a setStateThen callback but this is a bit of an edge case anyway
  • expire the slightly overloaded receiveProps, using optional lifecycle hooks instead (bigger API change)
  • something else I'm not thinking of?