You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Native crash on mount when using dataBind with ViewModel state machine value-change actions in .riv files #428
Bug: Native crash on mount when using dataBind with ViewModel state machine value-change actions
Description
Binding a ViewModel instance to RiveView via dataBind causes a native crash on mount whenever the loaded .riv file contains state machine ViewModel value-change actions.
The crash happens during file initialization regardless of whether those actions are reachable from the initial state, and cannot be caught by a React error boundary.
Provide a repro
Minimal code reproduction
functionRivePreview(){const{ riveFile }=useRiveFile(require('./vm_value_change_test.riv'));const[instance,setInstance]=useState(null);useEffect(()=>{if(!riveFile)return;letcancelled=false;(async()=>{constvm=awaitriveFile.viewModelByNameAsync("TextModel");constinst=awaitvm?.createDefaultInstanceAsync();if(!cancelled)setInstance(inst??null);})();return()=>{cancelled=true;};},[riveFile]);if(!riveFile||!instance)returnnull;// Crashes on mount if .riv contains state machine ViewModel value-change actionsreturn<RiveViewfile={riveFile}dataBind={instance}/>;}
Steps to reproduce
Load a .riv file whose state machine contains ViewModel value-change actions.
Create a ViewModel instance via the async API and pass it via dataBind.
Native crash occurs during mount. No JS exception is thrown.
Expected behavior
When a ViewModel instance is bound via dataBind, state machine ViewModel value-change actions should apply to the bound instance without causing a native crash.
Actual behavior
App crashes natively during mount
No JavaScript error is thrown
React ErrorBoundary does not catch the crash
Things confirmed NOT to prevent the crash
autoPlay={false}
Moving the action to a state disconnected from the initial state
Using async API (viewModelByNameAsync / createDefaultInstanceAsync) instead of useViewModelInstance
Wrapping in a React ErrorBoundary
Not calling any JS-side setters
Removing the ViewModel value-change actions from the state machine in the Rive editor eliminates the crash entirely.
Source .riv / .rev files
A ZIP containing both the runtime .riv and the editor .rev file will be attached. vm_value_change_test.zip
Device & versions
Device: iPhone 13 Pro Max (physical device)
OS: iOS 26.3.1
React Native: 0.83.6
Expo: 55.0.17
@rive-app/react-native: 0.4.6
Additional context
The JavaScript side completes successfully: the .riv file loads, the ViewModel instance is created, and RiveView mounts before the native crash occurs.
Activity