3 ms·
> Classes are meant to have state. The state object is called state. Except that's not how React works at all. There's no state in the class that lives between
by Kiro 7y ago
> Classes are meant to have state. The state object is called state.
Except that's not how React works at all. There's no state in the class that lives between renders, it only seems that way due to... magic. The class gets destroyed and created between each render and the state object is automagically recreated with the previous state. You can complain about Hooks but saying they are magical and React classes are not is just wrong.