Closed
Description
Hi there 👋
I was digging through the code looking for ways to annotate propType values and found out that (luckily!) there's already support for that. As far as I can see, propType values can be annotated for values of:
What do you think about adding support for oneOfType
to that list? I'd also like to work on that if there's not a strong argument against it 🙂
Update
Whoops! Sorry, I think I misread the current state. Nested descriptions currently seem to be only supported for properties of shape
, like this:
{
icon: PropTypes.shape({
/** Name of the icon */
name: PropTypes.string
})
}
Now, to be a bit more specific, what I would like to enable is the following:
{
icon: PropTypes.oneOfType([
/** Name of the icon */
PropTypes.string,
/** Icon element to render */
PropTypes.element
])
}
What do you think?
Metadata
Metadata
Assignees
Labels
No labels