strothj/react-docgen-typescript-loader

How to choose just specific props to be generated?

Closed this issue · 2 comments

I have an ui-elements repo that extends ant-design, some components like Button, Input, etc have many native default props but I just want to document a few of them, is there a way to do that?

This is what it's generate by default:

screen shot 2018-10-15 at 12 36 35 pm

But what I really want is just a few of them.

Awesome, thanks @strothj this fixed the problem:

propFilter: (prop) => {
      if (prop.parent == null) {
        return true;
      }

      return prop.parent.fileName.indexOf('node_modules/@types/react') < 0;
    }