Skip to content

propFilter custom function example or doc update. #204

@tsiq-jeremy

Description

@tsiq-jeremy

Hey, can I add to your /examples directory an example using propFilter with a custom function? I found it a bit tricky. Possibly just updating the docs could help as well. For instance:

propsParser: require('react-docgen-typescript').withDefaultConfig([parserOptions]).parse

Is confusing because it looks like parseOptions is an array, but really it is an object. I think this would be more readable {parserOptions}.

Also the name of the option is propFilter, but the code below has

(props: PropItem, component: Component) => boolean
if (prop.parent) {
  return !prop.parent.fileName.includes('node_modules')
}

return true

So it is unclear if you are getting an array of props or a single prop.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions