Quantcast
Channel: ReScript Forum - Latest posts
Viewing all articles
Browse latest Browse all 2592

Are React components with many lines of code less performant?

$
0
0

Yes, you should break them apart even if there aren’t performance issues. First off, React re-renders from the node and everything below it (depends) when a node state changes. So you want to encapsulate state to small islands because of that. You can hack around this using useRef and managing it by yourself in your component, but then you don’t really need react, or at least you’re not using it in the opinionated way it’s supposed to be used.

Beyond that, even if it wasn’t a performance issue, working with components that are several thousands sloc must be an absolutely horrendous dx.


Viewing all articles
Browse latest Browse all 2592

Trending Articles