I am using MDBoostrap (similar to Bootstrap) for styling my elements in a React app. Now I have a select element which is written like as shown below.
<div>
<select id="Regions" style={errorSelect} value={this.state.userRegionId} onChange={this.handleRegionChange}>
{this.handleGetRegions()}
</select>
</div>
When it renders, it generates some HTML like this.
I tried doing something like this.
//...
const errorSelect = {
borderBottom: '2px solid #FF0000'
};
//...
<select id="Regions" className={errorSelect} value={this.state.userRegionId} onChange={this.handleRegionChange}>
{this.handleGetRegions()}
</select>
//...
As you can see, even if I apply className
or style
element in my React code, it won't affect since the main UI gets rendered/translated to input
and ul
elements. Any idea on how I can apply my own CSS by overriding (or adding an extra style) to this?