Is it possible or would a pull request be allowed to create an option for the Info add-on to allow hiding the prop types section or replacing it with text?
For those of us using TypeScript, it would be nice if we could hide it or replace it with custom text.
There's an option to pass an array of components to exclude.
https://github.com/storybooks/storybook/tree/master/addons/info#options-and-defaults
If I'm correct, those say I should be able to do something like this:
storiesOf("ComponentName", module)
.add("Test Component",
withInfo({propTablesExclude: [(<ComponentName />)], text: 'Text about component.'})(() => {
return (
<ComponentName />
)
})
)
correct.
Interesting. Not working for me but I'll investigate & open a new issue if I can find that it is a bug & not something wrong with TypeScript or my particular instance.
Thank you.
@mattferderer I managed to get it working by passing the component itself rather than the rendered component.
E.g.:
setDefaults({
propTablesExclude: [ComponentName],
...
});
Instead of:
setDefaults({
propTablesExclude: [ <MyComponent /> ],
});
This wasn't that apparent when reading the documentation. Perhaps it's worth explaining this is what should be passed into the options rather than the rendered components? I only worked this out by reading the source code and seeing that propTablesExclude was expected to be an array of functions.
@danielduan would adding a pull request to the docs to include an example like @mbellgb showed be acceptable?
@mattferderer would really appreciate that. sorry for the confusion.
I'll try & make a pull request today or tomorrow then, unless someone beats me to it.
I feel that hiding all of the prop types could be a useful feature. Right now the way to achieve that is by filling the propTablesExclude array, but if a component is created inside a story, then it will appear in the props table, unless it is added to that array inside the story. What about having a flag to display them or hide them?
@vanpacheco Working on a full replacement for addon-info that will have this feature and a lot more. Current progress:

More information about the project: https://medium.com/storybookjs/storybook-docs-sneak-peak-5be78445094a
Most helpful comment
@vanpacheco Working on a full replacement for
addon-infothat will have this feature and a lot more. Current progress:More information about the project: https://medium.com/storybookjs/storybook-docs-sneak-peak-5be78445094a