rive-react-native
rive-react-native copied to clipboard
[Feature] Support loading Rive animations from Expo Assets
This is a follow-up to #123 and #185 - please refer to these issues for additional context.
Description
This issue seeks to add support for Expo Assets to the React Native Rive integration.
Expo Assets enables developers to load custom assets asynchronously without needing to explicitly bundle them into the native app code. This enables features like hot-reloading during local development, as well as the ability to deploy updates through EAS update
Without this, there is a lot of friction that discourages the use of Rive on an Expo project:
-
During local development, you can't hot-reload Rive animations. You need to do a full build of your custom dev client.
-
After deployment, it is not possible to update the Rive animations embedded in the app without a new native build being published to the app store. There is no way to update the animations over EAS Update.
Current behavior
On iOS, it is already possible to use Expo Assets using the instructions found in the initial issue (#123)
On Android, this does not work. The Rive adaptor chokes when it receives a file://
URL.
Expected behavior
I can pass in a file://
URL from Expo Asset into the Rive adapter for React Native, and it works on all platforms.