I have React component:
<Dropdown
placeholder={field[propName].label}
id={propName}
fluid
multiple
selection
search
defaultValue={defaultOptions}
options={options}
/>
So options
and defaultOptions
is the same structure arrays {text: 'string, value: 'string'}
.
In semantic UI source code I found this:
/** Initial value or value array if multiple. */
defaultValue: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number,
PropTypes.arrayOf(PropTypes.oneOfType([
PropTypes.string,
PropTypes.number,
])),
])
That the reason why my code above gives me error:
`Warning: Failed propType: Invalid prop `defaultValue` supplied to `Dropdown`. Check the render method of `View`.`
So question is how then I should set defaultValue for multi selection type of Dropdown?