Component CSS is Not loaded
Installed version v0.9.1, I can use the component, but seems no CSS is loaded.
+1
I'm seeing this as well. Also in 1.0.0-beta.
I ended up importing the css in my main.scss file to get it to work fyi
@import url('../../node_modules/react-select/dist/react-select.css');
Thanks @pranav. That's a good workaround.
I import default.scss in /node_modules/react-select/lib/Select.js
require('../scss/default.scss');
it works too
for me it's still not working even after adding
require('../../node_modules/react-select/dist/react-select.css');
this is my work around: create a package.json file and include the following:
{
"style": "style.scss"
}
add the following line in style.scss
@import "react-select/scss/default";
+1
+1
This still seems to be present in the newest beta. I'm using browserify and trying to require the CSS file, but the transforms that allow me to do so that I've tried (partialify and browserify-css) don't seem to play well with babelify. This seems to be a long-standing issue and I'm wondering if there's a fix on the way.
+1
+1
for the time being, i went super simple, and copied the dist/react-select.css file into my project, and it works great.
import 'react-select/dist/react-select.css'; helped in my case (npm + webpack)
I needed import 'css!react-select/dist/react-select.css as well as the webpack css module
FYI, if you're using css-loader with ?modules enabled, you can override its default behavior like so:
:global {
@import "~react-select/scss/select";
}
Used @cema-sp's workaround, thank you! Wish there was a more elegant way to import the css though.
@cema-sp Thanks a ton :+1: Took me a long time to finally stumble on this ticket. Your're suggestion is working for me on webpack
I tried to add import Select from 'css!react-select/dist/react-select.css'; in the main js and in the files where I used this component but doesn't style it
+1
@huvber I directly linked the CSS via my index.html file
<link rel="stylesheet" type="text/css" href="node_modules/react-select/dist/react-select.css">
This seemed to fix the CSS issue. If you still get functionality issues check out #618
@huvber you should not import anything from css, just css itself (remove Select from from your import expression).