Home > Software design >  Set react-select options attribute to empty list
Set react-select options attribute to empty list

Time:10-08

I have react-select component and I want it to have empty list inside options. When I write

<Select
options={{ value: '', label: '' }}
/>

I get empty select but when I press dropDown Menu I get error

ScrollManager.tsx:48 Uncaught TypeError: props.options.map is not a function

CodePudding user response:

You have to pass an array of object

<Select
  options={[
    { value: '', label: '' }
  ]}
/>
  • Related