Skip to content
New issue

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

TS forwardRef support #878

Open
shilman opened this issue Nov 30, 2023 · 1 comment
Open

TS forwardRef support #878

shilman opened this issue Nov 30, 2023 · 1 comment

Comments

@shilman
Copy link

shilman commented Nov 30, 2023

The following input:

import React, { forwardRef } from 'react';

interface ButtonProps {
  variant?: 'small' | 'large';
  disabled?: boolean;
  children: React.ReactNode;
}

export const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(
  { disabled = false, variant = 'small', children },
  ref
) {
  return (
    <button type="button" disabled={disabled} ref={ref}>
      {children} {variant}
    </button>
  );
});

Produces:

{}

It's come up several times in Storybook: storybookjs/storybook#8894 and storybookjs/storybook#9511

Filed from storybookjs/storybook#24165

@UTGuy
Copy link

UTGuy commented Dec 7, 2023

I had to turn off docgen in storybook due to this bug. It keeps throwing errors and even my imports get hosed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants