Replies: 1 comment 3 replies
-
I like this, and we're considering it here #688 |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I often run into these two scenarios when working with the
styled
function:DOM elements that require a
type
prop:Composing
styled
components that need to select an active variant:Possible solution: add a 3rd argument to the
styled
function for props:This would essentially be a default props object, but added through composition, and not as a property on the component like React's to be deprecated
defaultProps
.Current alternatives:
For repeated use of
<TextInput>
or<RoundedButton>
the current solution is to wrap them in another React component likeconst TextInputWithType = (props) => <TextInput type="text" {...props} />
. But this becomes very verbose after adding TypeScript types and ref forwarding, and seems unnecessarily cumbersome for just specifying a prop without adding any logic.Beta Was this translation helpful? Give feedback.
All reactions