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
Calendar: Prop typings are not working correctly #6583
Comments
Can you provide a stackblitz link please ? |
https://stackblitz.com/edit/vitejs-vite-1hvojf?file=src%2FApp.tsx |
OK so it works for me in TypeScript here: https://stackblitz.com/edit/kd3h15?file=src%2FApp.tsx i think the issue is the Calendar detects the See here: primereact/components/lib/calendar/calendar.d.ts Lines 972 to 1041 in 686262f
|
The issue starts when I try to wrap the Calendar with a wrapping component. I tried, passing it a value and an onChange to see if it works, but the typing error still persists. Strange behavour, in theory it should work the same whether the component gets wrapper or not, right? |
It should it might be some TypeScript weirdness or magic that I don't know. |
Describe the bug
The selectionMode prop shows a TS error regardless of value passed: 'single' | 'multiple' | 'range'.
Reproducer
https://stackblitz.com/edit/vitejs-vite-1hvojf?file=src%2FApp.tsx
PrimeReact version
10.6.5
React version
18.x
Language
TypeScript
Build / Runtime
Vite
Browser(s)
No response
Steps to reproduce the behavior
I'm creating a custom wrapper around the Calendar component, like so:
I get the error:
Even when I just use the Component without creating a wrapper, passing in selectionMode value shows an error:
The text was updated successfully, but these errors were encountered: