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.94k stars 296 forks source link

State seems to be shared after the 2nd slide #179

Closed philmetzger closed 3 years ago

philmetzger commented 3 years ago

I have Slides which have buttons you can click to set the state like this:

const [decision, setDecision] = useState(null);

    const check = (decisionMade) => {
        setDecision(decisionMade);
    }

However for some odd reason, after second slide, the next slide has the state already set. Why? It seems every slide after the 2nd repeats the first and second state values.

philmetzger commented 3 years ago

Seems to be fixed when I pass a key into my component e.g. <Slide key={id} />