You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The text was updated successfully, but these errors were encountered:
smarajitdasgupta
changed the title
Not displaying React propTypes in the document
Not displaying React propTypes isRequired in the document
Mar 3, 2020
Did you ever find a solution for this? I am facing the same problem, I just set JSDoc and better-docs up in my react app. And when I set up the first component, it showed it correctly, but now that I was in the process of making docs for the rest of the components, I noticed that the isRequired always says 'No'. Even on the first component where I saw it say 'Yes' in the beginning.
Tried the sample react component with proptypes. The example gets generated fine but required is 'No' even if isRequired is added to proptype.
`/**
*/
const Documented = (props) => {
const { text } = props
return (
)
}
Documented.propTypes = {
/**
* Text is a text
*/
text: PropTypes.string.isRequired,
}
export default Documented`
This is my config
{ "tags": { "allowUnknownTags": true, "dictionaries": ["jsdoc"] }, "source": { "include": ["src"], "includePattern": ".+\\.js(doc|x)?$", "excludePattern": "(^|\\/|\\\\)_" }, "plugins": [ "plugins/markdown", "node_modules/better-docs/component", "node_modules/better-docs/category" ], "templates": { "better-docs": { "name": "My React components" } }, "opts": { "destination": "docs", "encoding": "utf8", "recurse": true, "verbose": true, "readme": "README.md", "template": "node_modules/better-docs/" } }
The text was updated successfully, but these errors were encountered: