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

Sidebar: closeIconRef parameter error #7255

Closed
Verlap opened this issue Sep 26, 2024 · 0 comments · Fixed by #7256
Closed

Sidebar: closeIconRef parameter error #7255

Verlap opened this issue Sep 26, 2024 · 0 comments · Fixed by #7256
Assignees
Labels
Typescript Issue or pull request is *only* related to TypeScript definition
Milestone

Comments

@Verlap
Copy link

Verlap commented Sep 26, 2024

Describe the bug

In sidebar headless version, closeIconRef parameter shows an error in Typescript even in the demo
I didn't find any solution to this

PrimeReact Sidebar headless URL https://primereact.org/sidebar/#headless
image

No overload matches this call.

Overload 1 of 2, '(props: ButtonProps): Button', gave the following error.

Type 'RefObject<HTMLElement | HTMLButtonElement>' is not assignable to type 'LegacyRef<Button> | undefined'.

Type 'RefObject<HTMLElement | HTMLButtonElement>' is not assignable to type 'RefObject<Button>'.

Type 'HTMLElement | HTMLButtonElement' is not assignable to type 'Button'.

Type 'HTMLElement' is missing the following properties from type 'Component<ButtonProps, any, any>': context, setState, forceUpdate, render, and 3 more.

  Overload 2 of 2, '(props: ButtonProps, context: any): Button', gave the following error.

    Type 'RefObject<HTMLElement | HTMLButtonElement>' is not assignable to type 'LegacyRef<Button> | undefined'.(2769)

index.d.ts(303, 9): The expected type comes from property 'ref' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes<Button> & Readonly<ButtonProps>'

index.d.ts(303, 9): The expected type comes from property 'ref' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes<Button> & Readonly<ButtonProps>'

Reproducer

https://stackblitz.com/run?file=src%2FApp.tsx

System Information

System:
    OS: Linux 5.0 undefined
    CPU: (5) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.20.3 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    primereact: latest => 10.8.3 
    react: 18.3.1 => 18.3.1

Steps to reproduce the behavior

No response

Expected behavior

No response

@Verlap Verlap added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Sep 26, 2024
@melloware melloware added Type: Bug Issue contains a defect related to a specific component. 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 Type: Bug Issue contains a defect related to a specific component. labels Sep 26, 2024
@melloware melloware self-assigned this Sep 26, 2024
@melloware melloware added this to the 10.8.4 milestone Sep 26, 2024
melloware added a commit to melloware/primereact that referenced this issue Sep 26, 2024
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
Development

Successfully merging a pull request may close this issue.

2 participants