akiran / react-slick

React carousel component
http://react-slick.neostack.com/
MIT License
11.72k stars 2.1k forks source link

Invariant Violation: Unable to find node on an unmounted component #1428

Open akbar-pyt opened 5 years ago

akbar-pyt commented 5 years ago

Thrown this error when run the test case if i am using component inside react-slick.

import React, { Component } from 'react';
import Slider from 'react-slick';
Class MyComponent extends Component {
    render() {
         return(
                  <Slider> 
                      <div>Test1</div>
                      <div>Test2</div>
                      <div>Test3</div>
                  </Slider>
         )
    }
}

Test Case

 it('Example', () => {
      const renderedValue = renderer
        .create(<MyComponent/>)
        .toJSON();
      expect(renderedValue).toMatchSnapshot();
    });

If i run the test case it shown the following error, Invariant Violation: Unable to find node on an unmounted component.

This issue will happen only when i add the div elements inside the slider alone. Can any one give some suggestion to resolve this?

benb1983 commented 5 years ago

I have the same issue

JulioGT commented 3 years ago

Hello community! Have you found a fix for this? I have the same problem as well.

Thank you.

anik commented 3 years ago

Same problem! Anyone get the solution?