Open JosuerBague opened 4 months ago
Can you provide a stackblitz link please ?
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 value
and sets the SelectionMode based on whether you pass it a single Date, a Date[] array, etc.
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
value
and sets the SelectionMode based on whether you pass it a single Date, a Date[] array, etc.See here:
The issue starts when I try to wrap the Calendar with a wrapping component. https://stackblitz.com/edit/kd3h15-yfszte?file=src%2FApp.tsx
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:![image](https://github.com/primefaces/primereact/assets/90120572/fd97446d-178d-40dd-b27b-fc4effd830a8)
Even when I just use the Component without creating a wrapper, passing in selectionMode value shows an error:
Expected behavior
Calendar should accept values for selectionMode prop.