Skip to content

No default ViewModel found for artboard Artboard.Β #373

@David-HommaDev

Description

@David-HommaDev

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>
);

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions