hossein-zare / react-native-dropdown-picker

A single / multiple, categorizable, customizable, localizable and searchable item picker (drop-down) component for react native which supports both Android & iOS.
https://hossein-zare.github.io/react-native-dropdown-picker-website/
MIT License
992 stars 296 forks source link

items in DropdownPicker has incorrect type #584

Closed henrybzhang closed 2 years ago

henrybzhang commented 2 years ago

For the following:

  const availableItems = ['bob', 'tim', 'matt']
...

  <DropDownPicker
    open={openDropdownArr[0]}
    value={dropdownValueArr[0]}
    items={availableItems} // error is here
    ...
  />
Type 'string[]' is not assignable to type 'ItemType<ValueType>[]'.
Type 'string' has no properties in common with type 'ItemType<ValueType>'.ts(2322)

How can I resolve this error? Or could I be pointed to the TypeScript documentation that deals with this issue?

criss02-cs commented 1 year ago

Same issue, how can i resolve?