I am using select2 from react-select library for select2 multiple select dropdown. I want to show dynamic defaultValue for dropdown.
Used this package from react-js import Select from 'react-select'
I have response for the defaultValue [{"label":"Shikha","value":2},{"label":"cccccc","value":11}] then i put this statically it works but when i use this.state.assignies it does not works
<Select
isMulti
name="users"
options={this.state.users}
className="basic-multi-select"
classNamePrefix="select"
onChange={this.handleSelect2Change}
defaultOptions={this.state.users_asgn}
/>
How to show dynamic defaultValue when i edit or get values from database to show how is already assigned