react-select
react-select copied to clipboard
tailwind and react-select don't work
Thanks for using react-select!
I tried classNamePrefix and className prop through the object, but it still doesn't work in any way. I tried to define classes in the global.css class Name Prefix file, for example a controller or something else, but the styles still didn't work. Maybe you can fix it? I tried on version @5 as well.7.4 and on @5.7.0, but still does not work
Is this a specificity issue? Below worked for me.
***** component *****
<Select
value={selected}
onChange={handleSelected}
options={options}
className='_select'
classNamePrefix='_select'
/>
***** global.css *****
@layer components {
._select {
@apply w-full;
}
._select ._select__control {
@apply bg-base-gray-900;
}
}