Winner95 / typescript-react-function-component-props-handler

Custom react function component props handler for react-docgen. It allows you to parse props, which are typed as React.functionComponent<props> without rewriting your code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow components using forwardRef

ddouglasz opened this issue · comments

Hello,
Components that use React.ForwardRef seem to be caught somewhere with an error because of a parentPath check. We want to be able to set param type name for such components.

something about this code snippet check seems to be affecting it;

  if (path.parentPath.node.init && path.parentPath.node.init.params.length === 0) {
        return;
   }

I have a PR for this if thats okay.
Please kindly let me know if this has been an issue in the past and if there is a better solution, I will be happy to follow.