nextui
nextui copied to clipboard
[BUG] - Accordion Controlled Example shows errors
NextUI Version
2.2.9
Describe the bug
When following the controlled accordion example I am seeing the following error despite the functionality working as expected.
Type 'Dispatch<SetStateAction<Set<string>>>' is not assignable to type '(keys: Selection) => any'.
Types of parameters 'value' and 'keys' are incompatible.
Type 'Selection' is not assignable to type 'SetStateAction<Set<string>>'.
Type 'string' is not assignable to type 'SetStateAction<Set<string>>'.ts(2322)
Changing the erroring line to the following resolves the issue as a workaround:
onSelectionChange={(keys: Selection) => setSelectedAccordionKeys(keys as Set<string>)}
Your Example Website or App
No response
Steps to Reproduce the Bug or Issue
- Follow controlled example
- View error
Expected behavior
Controlled example works without errors
Screenshots or Videos
Operating System Version
macOS
Browser
Chrome
Hi @chasemcdo, I will take a look at this one! Thanks!