How to move from propTypes to jsDoc for react javascript arg/prop documentation? #29163
Unanswered
aaronbarker
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
We have a storybook instance that is currently pulling in propTypes defined in the component to populate the Args table.
We saw that prop-types has been "archived by the owner on Sep 1, 2024. It is now read-only." and so wanted to move to jsDoc. The jsDoc direction was based on in the Storybook 7 Docs post saying "we’ve leaned into JSDoc as the method of choice" for component and story descriptions... but maybe that is the extent of the leaning in, and not for args/props.
When I change to use a jsDoc block of code it does indeed pull in the description, but then all the args/props are also included as description and doesn't do anything in the args table.
I know that I can duplicate the descriptions in the story, but that duplicates the descriptions which is no fun to maintain. There would still be extra info in the description that is incorrect, and if I remove that extra info I don't get any IDE enhancements that are provided by the jsDocs.
Am I doing the jsDoc block incorrectly? Is there a different way to replace propTypes? Is propTypes what still needs to be used even though it has been archived?
Additional information
No response
Create a reproduction
https://stackblitz.com/edit/github-cvakjv?file=src%2Fstories%2FButton.jsx,src%2Fstories%2FButton.stories.js&preset=node
Beta Was this translation helpful? Give feedback.
All reactions