rive-app / rive-react

React runtime for Rive
https://rive-app.github.io/rive-react
MIT License
819 stars 32 forks source link

animations change don't work correctly #67

Open Kassan424kh opened 2 years ago

Kassan424kh commented 2 years ago

Hello Rive,

after i change the state in the animations attribute, the animation can no longer be displayed.

rive-react is use 1.0.4

import "./styles.sass";
import Rive from "rive-react";

const LoadingAnimation = ({ dark }) => {
    return (
        <Rive
            className="loading-animation"
            src={`/rive/loadinganimation.riv`}
            autoPlay
            useOffscreenRenderer={false}
            animations={dark ? "dark" : "light"}
        />
    );
};

export default LoadingAnimation;

image

closest to https://github.com/rive-app/rive-react/issues/65

avivian commented 2 years ago

Hey @Kassan424kh, I'm not able to reproduce your issue. When I try with my own example it's working fine. Would you be able to share the .riv file where you are seeing this happen?

Kassan424kh commented 2 years ago

Hey @avivian,

hmm weird 🤔. here's the file export.zip

Kassan424kh commented 2 years ago

I has created Codesandbox example https://codesandbox.io/s/loadinganimation-tskp6f

zplata commented 2 years ago

@Kassan424kh We've had some updates since - I'm looking at the codesandbox which seems to be using an updated version, and am not able to see the animation disappearing. Do you still see the issue on your end?

Kassan424kh commented 2 years ago

Hi @zplata, Sorry i fixed the showing animation problem, but i still has the same problem with changing animation after state change it still not working.