Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
9 changes: 4 additions & 5 deletions example/src/pages/OutOfBandAssets.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as React from 'react';
import {
ActivityIndicator,
SafeAreaView,
ScrollView,
StyleSheet,
Text,
Expand Down Expand Up @@ -52,14 +51,14 @@ export default function StateMachine() {
return <ActivityIndicator />;
} else if (error != null) {
return (
<SafeAreaView style={styles.safeAreaViewContainer}>
<View style={styles.safeAreaViewContainer}>
<Text>Error loading Rive file</Text>
</SafeAreaView>
</View>
);
}

return (
<SafeAreaView style={styles.safeAreaViewContainer}>
<View style={styles.safeAreaViewContainer}>
<RiveView
file={riveFile}
fit={Fit.Contain}
Expand Down Expand Up @@ -109,7 +108,7 @@ export default function StateMachine() {
</View>
</View>
</ScrollView>
</SafeAreaView>
</View>
);
}

Expand Down
2 changes: 1 addition & 1 deletion example/src/pages/RiveDataBindingExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { type Metadata } from '../helpers/metadata';

export default function WithRiveFile() {
const { riveFile, isLoading, error } = useRiveFile(
require('../../assets/rive/rewards_source.riv')
require('../../assets/rive/rewards.riv')
);

return (
Expand Down
56 changes: 56 additions & 0 deletions expo-example/app.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
module.exports = {
expo: {
name: 'expo-example',
slug: 'expo-example',
version: '1.0.0',
orientation: 'portrait',
icon: './assets/images/icon.png',
scheme: 'expoexample',
userInterfaceStyle: 'automatic',
newArchEnabled: true,
ios: {
supportsTablet: true,
bundleIdentifier: 'com.rive.expo-example',
},
android: {
adaptiveIcon: {
backgroundColor: '#E6F4FE',
foregroundImage: './assets/images/android-icon-foreground.png',
backgroundImage: './assets/images/android-icon-background.png',
monochromeImage: './assets/images/android-icon-monochrome.png',
},
edgeToEdgeEnabled: true,
predictiveBackGestureEnabled: false,
package: 'com.rive.expoexample',
},
web: {
output: 'static',
favicon: './assets/images/favicon.png',
},
plugins: [
'expo-router',
[
'expo-splash-screen',
{
image: './assets/images/splash-icon.png',
imageWidth: 200,
resizeMode: 'contain',
backgroundColor: '#ffffff',
dark: {
backgroundColor: '#000000',
},
},
],
[
'expo-asset',
{
assets: ['../example/assets/rive/rewards.riv'],
},
],
],
experiments: {
typedRoutes: true,
reactCompiler: true,
},
},
};
7 changes: 0 additions & 7 deletions src/hooks/useRiveFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ export function useRiveFile(
[options.referencedAssets]
);
const initialReferencedAssets = useRef(referencedAssets);
const initialInput = useRef(input);

useEffect(() => {
let currentFile: RiveFile | null = null;
Expand Down Expand Up @@ -162,12 +161,6 @@ export function useRiveFile(
}
}, [referencedAssets, riveFile]);

if (initialInput.current !== input) {
console.warn(
'useRiveFile: Changing input after initial render is not supported.'
);
}

return {
riveFile: result.riveFile,
isLoading: result.isLoading,
Expand Down
Loading