4 React anti-patterns: 1


4 React anti-patterns:

1. Syncing state that can be derived on render via useEffect.

2. Using useMemo/useCallback everywhere.

3. Putting nearly all state in context.

4. Disabling react-hooks/exhaustive-deps.

#react
These anti-patterns quickly proliferate once they're in the code.

The solution? Watch for these in code reviews, and reject PRs that needlessly do these things.

These patterns should be extremely rare.

View original on X