better-docs icon indicating copy to clipboard operation
better-docs copied to clipboard

export default function Component() won't recognize component name

Open tomas-hartman opened this issue 5 years ago • 3 comments

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.

tomas-hartman avatar Aug 14 '20 09:08 tomas-hartman

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.

wojtek-krysiak avatar Aug 24 '20 09:08 wojtek-krysiak

Thanks for mentioning that @tomas-hartman. Completely second you on this.

geekinate1 avatar Aug 19 '21 08:08 geekinate1

This issue hasn't been active in a while but I'm still getting this and it prevents the doc tool from working completely.

kjsmita6 avatar Nov 20 '22 17:11 kjsmita6