Avoid creating flexible React components with many props


Avoid creating flexible React components with many props.

Instead, start "rigid" (few props).

Benefits:
Enforce consistency
Simpler code
Easy to understand = hard to misuse
Ship faster = feedback faster
Avoids unused features
Props are easy to add, hard to remove

#reactjs
There's nothing wrong with ultimately creating a flexible React component. But starting "rigid" assures that each prop is necessary.

So, I add props when needed, instead of just in case. This keeps things simple, speeds completion, and avoids waste.

View original on X