datepicker styles are not loaded - class="undefined"
See original GitHub issueThere seems to be some issue with loading css modules. I’m importing react-persian-datepicker
as follows:
import { DatePicker } from 'react-persian-datepicker';
and I’m using <DatePicker/>
is my component.
I’m also using css-loader
and style-loader
as stated in the docs:
Note that you need css-loader for /.css$/ files enabled to have the styles working as we use css modules to put classnames in place.
my webpack config module
section:
{
test: /\.css$/,
exclude: /node_modules/,
loader: 'style-loader!css-loader?modules&importLoaders=1',
},
{
test: /\.css$/,
include: /node_modules/,
loader: 'style-loader!css-loader',
},
Any idea how to fix this?
Issue Analytics
- State:
- Created 6 years ago
- Comments:6
Top Results From Across the Web
react-datepicker styles are not being not applied on deployed ...
I'm using the react-datepicker npm module and its styles got broke (styles are not being applied) when I deploy the build, it's working...
Read more >react-datepicker - npm
A simple and reusable datepicker component for React. Latest version: 4.8.0, last published: 7 months ago. Start using react-datepicker in ...
Read more >Date picker not working. Only showing input field
I figured out the reason. Loading of styles and scripts occurs if the content ($post->post_content) contains a shortcode ([salon/] etc.). But if the...
Read more >SharePoint 2013 Datepicker Not Rendering Correctly
I have all my styles/layouts/css/js in a separate folder in the masterpage folder. I have this working on one site collection, but for...
Read more >css is not applying for the date picker in my inner jsp
Hi, I am using date picker in my JSP as below. <input type="text" id="d1" class="inputbox datepicker" /> which is working fine with in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Fix it like this:
const styles= { calendarContainer: ‘calendarContainer’, dayPickerContainer: ‘dayPickerContainer’, monthsList: ‘monthsList’, daysOfWeek: ‘daysOfWeek’, dayWrapper: ‘dayWrapper’, selected: ‘selected’, heading: ‘heading’, next:‘next’, prev:‘prev’, title:‘title’, } <Calendar styles={ styles } /> <DatePicker calendarStyles={ styles } />