Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upfix(types): add bootstrap sizes for Form.Label as column #3731
Conversation
|
||
export interface FormLabelProps { | ||
export interface FormLabelProps extends ColProps { |
This comment has been minimized.
This comment has been minimized.
jquense
May 2, 2019
Member
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
This comment has been minimized.
This comment has been minimized.
dalevfenton
May 2, 2019
Author
Contributor
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.
can you also add a few tests in |
This comment has been minimized.
This comment has been minimized.
one thing to note is that since |
This comment has been minimized.
This comment has been minimized.
@jquense I think this should be good to go now. |
This comment has been minimized.
This comment has been minimized.
thanks! |
dalevfenton commentedMay 1, 2019
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