I want to display the default value in ReactSelect's defaultValue, but when the state is updated, the defaultValue is not updated. The default display is not updated.
What can I do to avoid this phenomenon? I would appreciate it if you could tell me more about it.
constructor(props) {
super(props)
this.state = {
item: props.item,
};
}
const set = { label: this.state.item.name, value: this.state.item.id }
<Select
options={groupOptions}
defaultValue={set}
/>