|
|
|
|
|
by azangru
848 days ago
|
|
Examples from the conversations of that time: > ...we want closures to capture the values we rendered with, and to keep "seeing" those values forever. That's really important for concurrent mode where a notion of current value doesn't really exist. Hooks design models a component as being in many non-clashing states at the same time, instead of switching the "current" state (which is what classes model well). People don't really need to think about these details, but they're motivating the design a lot. [0] > In Concurrent Mode, render may run more then one time, and since this in a class is mutable, renders that should be the same may not be. [1] [0] - https://github.com/reactjs/rfcs/pull/68#issuecomment-4778866... [1] - https://tkplaceholder.io/why-function-components-fit-react-b... |
|