Simple pattern to reduce the pain of “prop drilling”: Consider using an...


Simple pattern to reduce the pain of “prop drilling”: Consider using an object instead of separate props.

Another advantage to this approach: When props are added/removed/renamed, it doesn’t require any changes to components that are merely passing the object down. 😎

#react

I like to use an object to group related props as well. It makes the props easier to understand when related props are grouped in an object.

The object conveys "this stuff is related".

View original on X