React rendering can get very very slow. A classical example are inputs that update very slowly when you type something. "Best practices" lead us many times to this when we round-trip the whole state from input change event, to global store object, immutable changes and back to the input. You can fight it with React.memo and by just mutating the state in-place.
Recently, I found valtio helpful as it allows to hook React components to rendering for parts of the global state.
Also all this useEffect(), useLayoutEffect(), and when it's not enough useEffectEvent() [1] and useEvent().
React rendering can get very very slow. A classical example are inputs that update very slowly when you type something. "Best practices" lead us many times to this when we round-trip the whole state from input change event, to global store object, immutable changes and back to the input. You can fight it with React.memo and by just mutating the state in-place.
Recently, I found valtio helpful as it allows to hook React components to rendering for parts of the global state.
Also all this useEffect(), useLayoutEffect(), and when it's not enough useEffectEvent() [1] and useEvent().
[1] https://react.dev/reference/react/experimental_useEffectEven...