theKashey / react-memoize

🧠 React memoization library we all deserve
MIT License
129 stars 4 forks source link

Use componentDidUpdate instead of getDerivedStateFromProps #1

Open theKashey opened 6 years ago

theKashey commented 6 years ago

Use componentDidUpdate instead of getDerivedStateFromProps to run side-effects?

Currently, one could use selector/flow-step with side-effect, and have to defer any state change he could execute inside, leading to 2 problems.

  1. memoize-state does not properly work with async stuff, concreting usage just after a function call.
  2. Possible double rendering.