aweary / react-copy-write

✍️ Immutable state with a mutable API
MIT License
1.79k stars 54 forks source link

Use getDerivedStateFromProps to track re-renders #42

Closed aweary closed 6 years ago

aweary commented 6 years ago

This lets us avoid the consume API, which can be really hard to remember. We'll re-render a bit more frequently, but users can always use PureComponent to wrap this consumer if they want to prevent re-renders from prop changes.