question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not work with css module

See original GitHub issue

After 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:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

12reactions
pixelomocommented, Jul 2, 2018

your docs are shockingly bad

1reaction
akirancommented, Jun 15, 2018

This might not be a problem with react-slick.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found