React mistake: State too high


React mistake: State too high.

If state is merely passed down to one child, it’s too high. It should be moved down to the child.

Benefits:
- Eliminates needless props.
- Makes state easier to read.
- Improves performance by avoiding needless renders.

Example:
Anyone seen an ESLint rule for this? Would be super handy since it's an easy mistake to make, and hard to catch in code reviews.

View original on X