Needless React props = needless complexity


Needless React props = needless complexity.

Example:
1. A component is intended for one use.
2. It accepts accepts a prop that *isn't used by the parent*. It's merely passed down.

Solution:
Delete the prop. Move the state or callback down to the child.

Principle:
Keep state and logic as local as possible. This reduces complexity, improves performance, aids readability, and eliminates needless code.

View original on X