rive-app / rive-react

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

fix: catch RiveFile initialization error in hook #269

Closed damzobridge closed 2 weeks ago

damzobridge commented 2 weeks ago

This PR addresses the issue with the useRiveFile hook not properly catching RiveFile initialization errors.

petersli commented 1 week ago

thank you so much! 🙌 will there be a patch release for this?

damzobridge commented 1 week ago

thank you so much! 🙌 will there be a patch release for this?

@petersli should be available from v4.12.1 !

petersli commented 4 days ago

hi @damzobridge, I think this actually doesn't catch the errors thrown by file.init() due to it being async. I think this could fix it: https://github.com/rive-app/rive-react/pull/270

damzobridge commented 4 days ago

Thanks @petersli , you're right! However, we're also working on updating the core rive-wasm package to catch all the RiveFile.init() issues and report them using the error callbacks. Once that's done we'll push out a fix for the react package.