-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(types): add bootstrap sizes for Form.Label as column #3731
fix(types): add bootstrap sizes for Form.Label as column #3731
Conversation
types/components/FormLabel.d.ts
Outdated
|
||
export interface FormLabelProps { | ||
export interface FormLabelProps extends ColProps { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if the right way to do this is via a type Union, e.g. FormLabel | FormLabelWithColProps
there column
is true
or false
specifically (instead of boolean
) to allow TS to differentiate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I started to do that, but didn't see that throughout the other typings so I wasn't sure if there was a preferred style. Let me write it up with the type Union.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you also add a few tests in simple-test.tsx
for this
one thing to note is that since |
@jquense I think this should be good to go now. |
thanks! |
I'm not sure if just extending
FormLabelProps
withColProps
is the preferred way to solve this issue or if you would want something that actually enforces that the column size props are only valid whencolumn
istrue
.I can make the typing stricter if that's preferred. It also seems like generally types aren't imported around and reused so if that's a problem I can copy them over completely from
Col.d.ts