-
Notifications
You must be signed in to change notification settings - Fork 66
Open
Labels
Description
import Rive, { AutoBind, RNRiveError, RNRiveErrorType, useRive } from 'rive-react-native';
import { View } from 'react-native';
import { useRef } from 'react';
export default function Demo() {
const [setRiveRef, riveRef] = useRive()
console.log(riveRef)
return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Rive
ref={setRiveRef}
dataBinding={AutoBind(true)}
source={require('@/assets/animations/animacao.riv')}
artboardName='Artboard'
onError={(riveError: RNRiveError) => {
switch (riveError.type) {
case RNRiveErrorType.DataBindingError: {
console.error(`${riveError.message}`)
return
}
default:
console.error('Unhandled error')
return
}
}}
style={{ width: 300, height: 300 }}
/>
</View>
);
}
johnsnaply and David-HommaDev