-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Access property type for documentation purposes at run time #60
Comments
It looks like an interesting idea, I'm playing with Being able to retrieve the What I actually need:
|
Has the idea of adding something like a Person.propTypes = {
name: PropTypes.string.isRequired.description("The persons first and last name")
} Another idea we had was adding a proprietary attribute like Person.propDescriptions = {
name: "The persons first and last name"
} See also diegohaz/parse-prop-types#6 |
Isn't the name of the prop the description already? |
Oftentimes yes, but in some cases its useful to describe the prop a bit further. |
Looking at how storybook and random questions on the internet it looks like it would be preferable to be able to pull the
type
of the property after it has been set.I have a simple POC I can submit as a PR if that would be preferred. Code below as to what I would be expecting to have as an end result.
The text was updated successfully, but these errors were encountered: