React-styleguidist: Component is named ForwardRefExoticComponent

Created on 15 Aug 2019  路  2Comments  路  Source: styleguidist/react-styleguidist

Whenever I wrap a FC in React.forwardRef, styleguidist always picks the name ForwardRefExoticComponent.

I've tried

/**
 * @visibleName FileSelect
 */
const FileSelect = React.forwardRef((props, ref) => ... )
FileSelect.displayName = "FileSelect";
/**
 * @visibleName FileSelect
 */
export default FileSelect;
/**
 * @visibleName FileSelect
 */
const FileSelectFC: React.RefForwardingComponent = (props, ref) => { ... };
FileSelectFC.displayName = "FileSelect"
/**
 * @visibleName FileSelect
 */
const FileSelect = React.forwardRef(FileSelectFC);
FileSelect.displayName = "FileSelect";
/**
 * @visibleName FileSelect
 */
export default FileSelect;

but doesn't seem to work.

Is it not supported?

wontfix

Most helpful comment

the solution for us was to wrap the exported component into a react function
export default Input as React.FC<React.HTMLProps<HTMLInputElement> & ComponentProps>;

All 2 comments

the solution for us was to wrap the exported component into a react function
export default Input as React.FC<React.HTMLProps<HTMLInputElement> & ComponentProps>;

馃槾 This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week without any further activity. Consider opening a pull request if you still have this issue or want this feature.

Was this page helpful?
0 / 5 - 0 ratings