in the 'React select' docs (https://react-select.com/styles#style-object) it says that you can change the styles of the select container, but I can't find how to change the root element style.
can it be done? and how?
in the 'React select' docs (https://react-select.com/styles#style-object) it says that you can change the styles of the select container, but I can't find how to change the root element style.
can it be done? and how?
If I understand you correctly, the root element has no styles (expect position: relative; box-sizing: border-box;) so I'm not sure what styles you want to change but you can set its styles by targeting its className.
e.g
<Select
className="container"
/>
.container {
background: red;
}
https://codesandbox.io/s/hungry-hawking-2prwd?file=/example.js
A bit explanation: react-select doesn't offer a prop for the root element because there is no need to. The whole reason of the styles prop is because the inner classes are scoped (For example). This is not the case of the root element.