better-docs
better-docs copied to clipboard
export default function Component() won't recognize component name
Using with react functional components, better-docs doesn't recognize correct name of the component when the component is exported on its definition:
export default function Component(){ ... }
It then results into something like this.
On the other hand it works well when I export the component after its definition, like this:
function Component(){ ... }
export default Component;
So, my suggestion is, that better-docs should support both notations.
sometimes there are strange things happening like that. It is related to the fact that better-docs, before passing everything to jsdoc core, uses tsc to transpile code from ts/esx to regular javascript. And this might cause the issues.
Thanks for mentioning that @tomas-hartman. Completely second you on this.
This issue hasn't been active in a while but I'm still getting this and it prevents the doc tool from working completely.