4 ms·
Something that I really like about React is that it is easy to reason about the state of each component, with functions there was no state, with classes, you ca
by omeid2 8y ago
Something that I really like about React is that it is easy to reason about the state of each component, with functions there was no state, with classes, you can see everything that touches the state there in your class.
I am not sure how having various functions (hooks) that trigger state changes and so re-rendering is going to pan-out in practice.
Here comes setInterval and counter packages, no I don't believe I can simply avoid using them, everyone depended on leftpad, indirectly.
- gurschitz 8y agoThere is a blogpost from dan abramov about using setInterval with hooks: https://overreacted.io/making-setinterval-declarative-with-react-hooks/ https://overreacted.io/making-setinterval-declarative-with-r...
- deleted 8y ago[deleted]
- mambodog 8y agoHow is this different to using a React component installed from npm? You can look inside them if you want to, but don't have to. That is the goal of abstraction. If you want to have no abstraction and show all state in your component, just don't extract any into Custom Hooks. Then it's really not very different to a class component.