I am getting an error:
Warning: Use the
defaultValueorvalueprops on instead of settingselectedon .
<Select
onChange={props.changecompany}
value={props.currCompany != undefined ? props.currCompany.id : -1}
>
<option key={'empty'} value={'-1'}>
None
</option>
{mapstructure()}
</Select>;
And here is my mapstructure()
const mapstructure = () => {
return companies.map((company) => (
<option key={company.Id.toString()} value={company.Id}>
{company.Name}
</option>
));
};
I'm still learning so it is probably something fairly obvious, but the google solutions havent seemed to have fixed it. TIA