Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not displaying React propTypes isRequired in the document #62

Open
smarajitdasgupta opened this issue Mar 3, 2020 · 1 comment
Open

Comments

@smarajitdasgupta
Copy link

smarajitdasgupta commented Mar 3, 2020

Tried the sample react component with proptypes. The example gets generated fine but required is 'No' even if isRequired is added to proptype.

Screen Shot 2020-03-03 at 9 39 17 pm

`/**

  • Some documented component
  • @component
  • @example
  • const text = 'some example text'
  • return (
  • )
    */
    const Documented = (props) => {
    const { text } = props
    return (
    {text}

    )
    }

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/" } }

@smarajitdasgupta smarajitdasgupta changed the title Not displaying React propTypes in the document Not displaying React propTypes isRequired in the document Mar 3, 2020
@AnthonMS
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants