1

I am trying to show my label for Select with material UI but it's showing option value instead of label...

here is the image of it:

enter image description here

here is my code base:

  const [inputFields, setInputFields] = useState([
    { id: uuidv4(), relationship: '', initiatorMessage: '', email: '' }]);

    inputFields?.map(inputField => {
      return (
      ...
      <FormControl
        className={classes.formControl}
        id="relationship-select"
        select
        name="relationship"
        inputprops={{
          classes: {
            root: classes.root,
          },
        }}
      >
        <Select
          name="relationship"
          label="relationship"
          value={inputField.relationship}
          onChange={e => handleChangeInput(inputField.id, e)}
          inputProps={{
            classes: {
              root: classes.root,
            },
          }}
        >
          {relationships.map(option => (
            <MenuItem key={option.value} value={option.value}>
              {option.value}
            </MenuItem>
          ))}
        </Select>
      </FormControl>
    })
  }

I want it to show relationship but it's showing my option value..

Nhan Nguyen
  • 355
  • 1
  • 6
  • 24

0 Answers0