nextui icon indicating copy to clipboard operation
nextui copied to clipboard

[BUG] - Accordion Controlled Example shows errors

Open chasemcdo opened this issue 2 years ago • 1 comments

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

  1. Follow controlled example
  2. View error

Expected behavior

Controlled example works without errors

Screenshots or Videos

image

Operating System Version

macOS

Browser

Chrome

chasemcdo avatar Feb 11 '24 17:02 chasemcdo

Hi @chasemcdo, I will take a look at this one! Thanks!

kuri-sun avatar Feb 11 '24 21:02 kuri-sun