React features I avoid at first, then only refactor to when necessary:...


React features I avoid at first, then only refactor to when necessary:

useReducer: Use when useState is insufficient (complex state)

useMemo/memo: Use when a perf issue

ref: Use when state/props aren’t an option

context: Use when a prop is passed nearly everywhere

#reactjs
To clarify, these are handy features. But I don’t reach for them by default. I see them as narrow power tools for rare instances.

So I don’t use them up front.

Instead, I refactor to use these tools only after they’re clearly necessary.

View original on X