3 ms·
> It's hard to wrap your head around some behaviors I've got a React maintenance and development project coming up in a few weeks. I'd love if you'd expand a b
by dotancohen 2y ago
> It's hard to wrap your head around some behaviors
I've got a React maintenance and development project coming up in a few weeks. I'd love if you'd expand a bit on these points and maybe point to some relevant docs. You could potentially save me days or more of tail chasing. Thanks.
- incrudible 2y agoPrimarily the rules of hooks and what does and does not trigger a render or a unmount. If your project still uses class instead of function components, that's a potential target for refactoring. > some relevant docs Read the docs. All of them. React isn't that big.
- dotancohen 2y agoThank you. Neither of those topics are new to me. Great to know!
- acemarke 2y agoThe biggest thing most people don't understand is that React re-renders recursively by default, regardless of whether any particular child component's props actually changed or not. Most of its behavior patterns follow from that one. I have an extensive post called "A (Mostly) Complete Guide to React Rendering Behavior) that covers the concepts and nuances in detail: - https://blog.isquaredsoftware.com/2020/05/blogged-answers-a-mostly-complete-guide-to-react-rendering-behavior/ https://blog.isquaredsoftware.com/2020/05/blogged-answers-a-...
- dotancohen 2y agoThank you.