Trying to populate an array of options for React-multi-select-dropdown
this.state.users.map((user) => {
if (!this.state.options.includes(user.badgeId))
this.state.options.push({ name: user.badgeId, id: user._id });
return this.state.options;
});
getting multiple values of the same in the options array.
<Multiselect
options={this.state.options} // Options to display in the dropdown
//isObject={false}
onSelect={this.onSelect} // Function will trigger on select event
// onRemove={this.onRemove} // Function will trigger on remove event
displayValue='name' // Property name to display in the dropdown options
/>
also once selected and form submitted the selected user.badgeId will need to be in its own array.