<li> cannot appear as a child of <select>

Viewed 415

Getting below error while using native in Select

<TextField 
  select
  value={options.length ? value : defaultValue}
  SelectProps={{
    native: true,
  }}>

I am using material UI Textfield.

validateDOMNesting(...): <li> cannot appear as a child of <select>.
    in li (created by ForwardRef(ButtonBase))
    in ForwardRef(ButtonBase) (created by WithStyles(ForwardRef(ButtonBase))) ```
1 Answers

I was having the same issue today, and the solution is to remove

SelectProps={{
    native: true,
  }}

That fixed it for me.

Have a nice day!

Related