-
Notifications
You must be signed in to change notification settings - Fork 257
Closed
Labels
staleThere is no activity for a long time.There is no activity for a long time.
Description
I ran into an issue earlier where union types caused the all of the props of a component not to be documented (the props names appeared in the documentation, but none of their descriptions, etc). I have removed my unions, but it's not the best solution.
There are cases where this is useful, when one prop should only be provided if another is present, and must be provided if another is present e.g.
interface FixedWidth {
fixWidth: true;
width: number;
}
interface FlexibleWidth {
fixWidth?: false;
width?: never;
}
type Props = FixedWidth | FlexibleWidth;jkarttunen, cristiandouce, jameslnewell, wbobeirne, kevinbarabash and 3 more
Metadata
Metadata
Assignees
Labels
staleThere is no activity for a long time.There is no activity for a long time.