I want to display like an error with red color unless there is a selected option. Is there any way to do it.
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- How to toggle on Order in ReactJS
- void before promise syntax
- Keeping track of variable instances
For setting a required Select field with Material UI, you can do:
Working Demo on CodeSandBox
Material ui has other types of Select(native) also where you can just use plain HTML required attribute to mark the element as required.
P.S. https://material-ui.com/demos/selects/#native-select