TLDR Web Dev · ARTICLES & TUTORIALS
REACT ANTI-PATTERN: STOP PASSING SETTERS DOWN THE COMPONENTS TREE
Summary from the TLDR Web Dev newsletter
Passing `useState` setter functions as props to child components is a React anti-pattern. This creates an abstraction leak, tightly coupling the child to the parent's internal state management and making the code fragile and less reusable. The solution is to instead pass a callback function that encapsulates the state change, allowing the child to update the parent's state without knowing the specific implementation details.