Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

>React is just as fast as anything else

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...





Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: