Not work with css module
See original GitHub issueAfter using css module in parent component, Slider throws following exception
Uncaught Invariant Violation: Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops. The above error occurred in the <InnerSlider> component: in InnerSlider (created by Slider) in Slider (at Slider.js:32) …
And if I remove cssmodules decorator from parent component, then Slider works well. Can not figure out why css module causes infinite render loop.
import React, { Component } from 'react'
import CSSModules from 'react-css-modules'
import styles from './index.css'
import Slide from 'react-slick'
// removing this line, then Slider renders well
@CSSModules(styles)
class Container extends Component {
render() {
return (
<div styleName="container">
<Slider />
</div>
)
}
}
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:8 (1 by maintainers)
Top Results From Across the Web
CSS modules not working for react version 16.6.0
Not working with React 17.0.1. The only way to make it work is Changing to UpperCase all the css classes in the css...
Read more >CSS module not working, maybe because of ... - Reddit
CSS module not working, maybe because of NewWindowComponent.js. Right now I made another component that is on a new window called Blog.js.
Read more >In v5 can't use import * as styles with css modules, bug? #11800
I mean import { style } from style.module.css is not working. It shows the same error export 'style' (imported as 'style') was not...
Read more >Using CSS Modules in React - OpenReplay Blog
A different way to work with CSS styling in React apps. ... In contrast to Styled Components, CSS Modules don't accept props.
Read more >A complete guide to CSS Modules in React (Part-1) - codeburst
Now the question arises how does this work? The answer is simple, with modular CSS, the class that we apply is not rendered...
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
your docs are shockingly bad
This might not be a problem with react-slick.