Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] What happens if I give undefined for a Rive file without a stateMachineName? #227

Closed
WooMinGy opened this issue Feb 20, 2024 · 2 comments

Comments

@WooMinGy
Copy link

image

I am encapsulating the Rive component for use. (Like the image above)
Naturally, I pass the stateMachineName as props to the Rive Component.
If I don't specify a stateMachineName in the Rive file and end up passing the file's URL with stateMachineName set to undefined, could this lead to unexpected errors?

Because I detected the error in the photo below through Sentry. (Only iOS)
image

@HayesGordon
Copy link
Contributor

Hi @WooMinGy , I always recommend setting the state machine name explicitly. As the default may unintentionally change when modifying the animation in the editor, or new artboards may be added, etc.

If you do not give the StateMachine name (or no animation name), then the defaults will be played as set in the editor (I need to confirm that Android does, in fact, play the default but iOS does). Either way, I would still set the state machine name and artboard name through code.

With the error you shared above, it seems like this particular artboard does not have a state machine name State Machine 1

@WooMinGy
Copy link
Author

WooMinGy commented Feb 21, 2024

@HayesGordon Thank you for your response.
After hearing what you said, we checked all of our team's Rive files and confirmed that if the stateMachineName is not specified, it defaults to having the name 'State Machine 1'.
We will make sure to explicitly set the stateMachineName for all of them and monitor the situation!
I'm gonna close the issue, thanks!

@WooMinGy WooMinGy closed this as not planned Won't fix, can't repro, duplicate, stale Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants