Good afternoon, now what I'm trying to do is the following:
I have a <select>
that has multiple categories with an id each, what I want to do is that in the case that this select is changed, I mean in a onChange
, it was sent as an argument to a function x, the value of this option selected, or the id if it had to be done in another way.
My select
<select>
<option default> ---- Select Category ---- </option>
{this.state.items.length ?
this.state.items.map(item=>
<option value={item.id}>{item.name}</option>
)
: <li>Loading...</li>
}
</select>