How can I remove the bar in the react-select? How can I remove the bar in the react-select? reactjs reactjs

How can I remove the bar in the react-select?


react-select allows us to control components by doing

components={{  IndicatorSeparator: () => null}}

For example:

<Select  id="search-commodity"  options={comodityOptions}  components={{    IndicatorSeparator: () => null  }}/>


The component you are looking to style is indicatorSeparator. For instance, add this to your styles:

indicatorSeparator: (styles) => ({display:'none'})

How did I find this out? I added classNamePrefix to the react-select properties and then used the inspector to see what the class name of the element was.