We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug Not all props are being generated in controls for a certain component.
To Reproduce
export type ButtonProps = { variant?: ButtonVariant; color?: ButtonColor; size?: ButtonSize; loading?: boolean; component?: "button"; innerRef?: Ref<any>; active?: boolean; startIcon?: string; endIcon?: string; } & React.ButtonHTMLAttributes<HTMLButtonElement>; export const Button = forwardRef( ( { children, variant = "contained", color = "primary", size, className, disabled, active, component = "button", loading = false, type = "button", innerRef, startIcon, endIcon, ...rest }: ButtonProps, ref ) => { const accessabilityNames = () => { const accessabilityObj: ButtonAccessability = {}; if (typeof children === "string") { return { "aria-label": children, title: children, }; } if (rest.title) { accessabilityObj.title = rest.title; accessabilityObj["aria-label"] = rest["aria-label"]; } if (rest["aria-label"]) { accessabilityObj.title = rest["aria-label"]; } return accessabilityObj; }; return React.createElement( component, { ref: innerRef || ref, className: classNames( { btn: true, disabled: disabled || loading, active, }, formatButtonVariantAndColor(variant, color), size && formatBtnSize(size), className ), type: type, disabled: disabled || loading, role: "button", ...accessabilityNames(), ...rest, }, <> {startIcon && <Icon icon={startIcon} />} {children} </> ); } );
module.exports = { stories: ["../src/**/*.stories.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"], addons: ["@storybook/addon-links", "@storybook/addon-essentials", "@storybook/addon-interactions", "@storybook/preset-scss"], framework: "@storybook/react", core: { builder: "@storybook/builder-webpack5", }, typescript: { reactDocgen: "react-docgen-typescript", reactDocgenTypescriptOptions: { compilerOptions: { allowSyntheticDefaultImports: false, esModuleInterop: false, }, }, }, };
export default { title: "Button", component: ButtonComponent, }; const Template = (args: any) => <ButtonComponent {...args}>Button</ButtonComponent>; export const Button = Template.bind({}); Button.args = { startIcon: "", endIcon: "", };
Additional context I don't have issues with other components, even those using forwardRef, so was wondering what might be causing the issue.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
Not all props are being generated in controls for a certain component.
To Reproduce
Additional context
I don't have issues with other components, even those using forwardRef, so was wondering what might be causing the issue.
The text was updated successfully, but these errors were encountered: