For example, I import a component from the library:
import Datetime from 'react-datetime' import 'react-datepicker/dist/react-datepicker.css' But in the browser, the component is displayed without styles.
For example, I import a component from the library:
import Datetime from 'react-datetime' import 'react-datepicker/dist/react-datepicker.css' But in the browser, the component is displayed without styles.
First you need to install css-loader
npm install css-loader --save-dev Then you need to add it to the bootloaders in the webpack configuration
module.exports = { //... module: { loaders: [ { test: /\.css$/, loader: "style-loader!css-loader" }, //... ] } }; Well, then you can already use css
import Datetime from 'react-datetime'; import 'react-datepicker/dist/react-datepicker.css'; Source: https://ru.stackoverflow.com/questions/761339/
All Articles