react-docgen-typescript-loader
react-docgen-typescript-loader copied to clipboard
JSDoc block is displaying inline
My code looks like:
/**
* Hook to check the action permission based on the rules and user's roles
*
* @param action - Action to check permission for
* @param data - Any data necessary for dynamic checks
* @param options - Allows overriding the rules and/or roles
* @return - True, if the user has permission to perform the provided action
*/
export function useAccess(action: ValidRule, data?: object, options: AccessOverrides = {}) {
//...
}
It generates a "description" of:
Hook to check the action permission based on the rules and user’s roles @param action - Action to check permission for @param data - Any data necessary for dynamic checks @param options - Allows overriding the rules and/or roles @return - True, if the user has permission to perform the provided action
I would expect it to pull the description out and parse the params/returns into the props table.
Where are you accessing the documentation for hooks in Storybook? It didn't occur to me there was a way to do that.
@strothj Using the @storybook/addon-info plugin for documentation. (https://github.com/storybooks/storybook/tree/master/addons/info)
Hooks are relatively unsupported AFAICT. Mostly just creating wrapping components in the story currently. The docs were still visible though.
Can you post the source of the story file? I want to get a better idea of what’s going on.
@strothj here is the story and hook https://gist.github.com/stramel/96aac465ed0fffba9cd2056ec8cd7580
UPDATE: Updated with my storybook config too.
This is based on a Typescript CRA project