Skip to content

Commit 0bea188

Browse files
committed
chore: use expo-assets to add rewards.riv from expo-example
1 parent f86844e commit 0bea188

5 files changed

Lines changed: 61 additions & 12 deletions

File tree

example/src/pages/OutOfBandAssets.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import * as React from 'react';
22
import {
33
ActivityIndicator,
4-
SafeAreaView,
54
ScrollView,
65
StyleSheet,
76
Text,
@@ -52,14 +51,14 @@ export default function StateMachine() {
5251
return <ActivityIndicator />;
5352
} else if (error != null) {
5453
return (
55-
<SafeAreaView style={styles.safeAreaViewContainer}>
54+
<View style={styles.safeAreaViewContainer}>
5655
<Text>Error loading Rive file</Text>
57-
</SafeAreaView>
56+
</View>
5857
);
5958
}
6059

6160
return (
62-
<SafeAreaView style={styles.safeAreaViewContainer}>
61+
<View style={styles.safeAreaViewContainer}>
6362
<RiveView
6463
file={riveFile}
6564
fit={Fit.Contain}
@@ -109,7 +108,7 @@ export default function StateMachine() {
109108
</View>
110109
</View>
111110
</ScrollView>
112-
</SafeAreaView>
111+
</View>
113112
);
114113
}
115114

example/src/pages/RiveDataBindingExample.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { type Metadata } from '../helpers/metadata';
1515

1616
export default function WithRiveFile() {
1717
const { riveFile, isLoading, error } = useRiveFile(
18-
require('../../assets/rive/rewards_source.riv')
18+
require('../../assets/rive/rewards.riv')
1919
);
2020

2121
return (

expo-example/app.config.js

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
module.exports = {
2+
expo: {
3+
name: 'expo-example',
4+
slug: 'expo-example',
5+
version: '1.0.0',
6+
orientation: 'portrait',
7+
icon: './assets/images/icon.png',
8+
scheme: 'expoexample',
9+
userInterfaceStyle: 'automatic',
10+
newArchEnabled: true,
11+
ios: {
12+
supportsTablet: true,
13+
bundleIdentifier: 'com.rive.expo-example',
14+
},
15+
android: {
16+
adaptiveIcon: {
17+
backgroundColor: '#E6F4FE',
18+
foregroundImage: './assets/images/android-icon-foreground.png',
19+
backgroundImage: './assets/images/android-icon-background.png',
20+
monochromeImage: './assets/images/android-icon-monochrome.png',
21+
},
22+
edgeToEdgeEnabled: true,
23+
predictiveBackGestureEnabled: false,
24+
package: 'com.rive.expoexample',
25+
},
26+
web: {
27+
output: 'static',
28+
favicon: './assets/images/favicon.png',
29+
},
30+
plugins: [
31+
'expo-router',
32+
[
33+
'expo-splash-screen',
34+
{
35+
image: './assets/images/splash-icon.png',
36+
imageWidth: 200,
37+
resizeMode: 'contain',
38+
backgroundColor: '#ffffff',
39+
dark: {
40+
backgroundColor: '#000000',
41+
},
42+
},
43+
],
44+
[
45+
'expo-asset',
46+
{
47+
assets: ['../example/assets/rive/rewards.riv'],
48+
},
49+
],
50+
],
51+
experiments: {
52+
typedRoutes: true,
53+
reactCompiler: true,
54+
},
55+
},
56+
};

src/hooks/useRiveFile.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,6 @@ export function useRiveFile(
162162
}
163163
}, [referencedAssets, riveFile]);
164164

165-
if (initialInput.current !== input) {
166-
console.warn(
167-
'useRiveFile: Changing input after initial render is not supported.'
168-
);
169-
}
170-
171165
return {
172166
riveFile: result.riveFile,
173167
isLoading: result.isLoading,

0 commit comments

Comments
 (0)