How to get object in <Select >

So, it seems like value="" is useless html attribute. Meaning, I need this, in order to set up which item should be selected. But when we submit, it, it uses value in text…
I would like to send user.userId through value={user.userId}, and have name for item what it shows for user.
But apparently, this doesn’t work, because it can’t keep selected value.
And I can’t get value I want with, it actually gets text of , and not userId in value={}

 const handleVotedFor = async (event) => {
    setVotedFor(; // we get object "user", and get .name

    try {
      var response = await
          NPuserId:, // and .userId of that NP in question


                style={{ color: "#000" }}
                { => (
                  <MenuItem key={} value={user}>

It’s not clear to me what you are asking or trying to do, so I could have interpreted this wrong.
But there is no value attribute for the select tag. The values belong in the option tags of the select.
If you want a default option to be selected, you put the selected attribute in that option.

<label for="number">Pick a number</label>
<select name="number" id="number">
    <option value="1">One</option>
    <option value="2">Two</option>
    <option value="3" selected>Three</option>
    <option value="4">Four</option>

3 is the default.

1 Like