You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Always spread props passed-in to root element. Destructure props passed in and name the remainingrest, which should be positioned at last after all other props to the root element. This makes sure consumers always having control of props, despite us imposing some default behaviour.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Always spread props passed-in to root element. Destructure props passed in and name the remaining
rest
, which should be positioned at last after all other props to the root element. This makes sure consumers always having control of props, despite us imposing some default behaviour.Worth noting that positioning of
ref
doesn't matter, as React doesn't allow that to be in props.Don't forget any other props a consumer may need to provide override, if we provide any default values, e.g.
style
.## Open discussions
rest
a bad variable naming? v.s.restProps
Beta Was this translation helpful? Give feedback.
All reactions