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

ButtonGroup: Typescript missing ref property definition #6357

Closed
dvpritzbuer opened this issue Apr 9, 2024 · 1 comment · Fixed by #6360, leoo1992/GeradorQRCode#23 or leoo1992/GeradorQRCode#27
Assignees
Labels
Typescript Issue or pull request is *only* related to TypeScript definition
Milestone

Comments

@dvpritzbuer
Copy link
Contributor

Describe the bug

"Property 'ref' does not exist on type 'IntrinsicAttributes & ButtonGroupProps'."

Possible fix would be to change the type definition to:
export declare const ButtonGroup: React.ForwardRefExoticComponent<React.PropsWithChildren<ButtonGroupProps> & React.RefAttributes<HTMLDivElement>>;

That would also remove the explicit property children?: React.ReactNode | undefined; from the ButtonGroupProps interface.
And just a small tip here: If you use property?: with question mark it's already the shortcut for "| undefined"

If you want I can open a PR for that.

Reproducer

https://stackblitz.com/edit/vitejs-vite-tmipcz?file=src%2FApp.tsx,package.json

PrimeReact version

10.6.3

React version

18.x

Language

TypeScript

Build / Runtime

Create React App (CRA)

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

No response

@dvpritzbuer dvpritzbuer added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Apr 9, 2024
@melloware melloware added Typescript Issue or pull request is *only* related to TypeScript definition and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Apr 9, 2024
@melloware melloware added this to the 10.6.4 milestone Apr 9, 2024
@melloware
Copy link
Member

I assigned this one to you too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Typescript Issue or pull request is *only* related to TypeScript definition
Projects
None yet
2 participants