Languages
[Edit]
EN

React - Material-UI Select component with array of objects

25 points
Created by:
Root-ssh
178180

In this short article, we would like to show how to use in React project, Material-UI Select component with array of objects as options.

By default, the select component doesn't use an options array, so it is necessary to add items inside using JSX notation.

Quick solution:

 

Practical example

Edit

Presented solution uses controlled component mode (value and onChange).

ControlledSelect.jsx file:

Example usage in App.jsx file:

 

References

Edit
  1. Material-UI Select - Official Docs 

Alternative titles

  1. React- Material-UI Select component with objects as options
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

ReactJS

React - Material-UI Select component with array of objects
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join