I have a component that is exported this way : export const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(...)
When I look into the code generated by webpack, it looks like this :
exports.IconButton = (0, react_1.forwardRef)((_a,ref)=>{...});
exports.IconButton.displayName = 'IconButton';
try {
// @ts-ignore
IconButton.displayName = "IconButton";
// @ts-ignore
IconButton.__docgenInfo = {
...
};
// @ts-ignore
if (typeof STORYBOOK_REACT_CLASSES !== "undefined")
// @ts-ignore
STORYBOOK_REACT_CLASSES["src/components/buttons/icon-button.tsx#IconButton"] = {
docgenInfo: IconButton.__docgenInfo,
name: "IconButton",
path: "src/components/buttons/icon-button.tsx#IconButton"
};
} catch (__react_docgen_typescript_loader_error) {}
The generated code doesn't include the exports. prefix, which ends up throwing this error : ReferenceError: IconButton is not defined (logged __react_docgen_typescript_loader_error);
I have a component that is exported this way :
export const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(...)When I look into the code generated by webpack, it looks like this :
The generated code doesn't include the
exports.prefix, which ends up throwing this error :ReferenceError: IconButton is not defined(logged__react_docgen_typescript_loader_error);