rcaferati / react-awesome-slider

React content transition slider. Awesome Slider is a 60fps, light weight, performant component that renders an animated set of production ready UI general purpose sliders with fullpage transition support for NextJS and GatsbyJS. 🖥️ 📱
https://fullpage.caferati.me
MIT License
2.92k stars 294 forks source link

Module not found: Can't resolve 'react-awesome-slider/src/styled/fold-out-animation.scss' #177

Closed BauerKristof closed 3 years ago

BauerKristof commented 3 years ago

Hey guys.

I have installed properly the AwsomeSlider and it is working fine, but when I try to use with the Fold out animation (or any animation bascailly ) I get the following error: Module not found: Can't resolve 'react-awesome-slider/src/styled/fold-out-animation.scss' . I tested on this code snippet:

import AwesomeSlider from 'react-awesome-slider';
import AwesomeSliderStyles from 'react-awesome-slider/src/styled/fold-out-animation.scss';

function SomeComponent(props) {
 return(
 <AwesomeSlider  cssModule={AwesomeSliderStyles}>
                {Images.map((img, index) => (
                    <div data-src={`${pageUrl}${img}`} key={index} />
                ))}
  </AwesomeSlider>
 );
}

export default SomeComponent

What am I doing wrong?

BauerKristof commented 3 years ago

I solved it in the following way:

import AwesomeSlider from 'react-awesome-slider';
import 'react-awesome-slider/dist/custom-animations/cube-animation.css';

   <AwesomeSlider  animation="cubeAnimation" selected={2}>
                {Images.map((img, index) => (
                    <div data-src={`${pageUrl}${img}`} key={index} />
                ))}