rive-app / rive-app/rive-react-native
Error: dispatchViewManagerCommand: found null reactTag, js engine: hermes
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 783
- Forks
- 81
- Avg merge
- 3d 6h
- Merged PRs (30d)
- 3
Description
Sometimes during setInputState, I get this error, which crashes the app on release APK builds: Error: dispatchViewManagerCommand: found null reactTag, js engine: hermes
I managed to fix it by adding a null check in this file Rive.tsx, but I'm not sure why this occurs yet.
const setInputState = useCallback<RiveRef['setInputState']>(
(triggerStateMachineName, inputName, value) => {
// added null check
let nodeHandle = findNodeHandle(riveRef.current);
if(nodeHandle === null) {
console.error('RiveRef is not available');
return;
}
if (typeof value === 'boolean') {
UIManager.dispatchViewManagerCommand(
findNodeHandle(riveRef.current),
ViewManagerMethod.setBooleanState,
[triggerStateMachineName, inputName, value]
);
} else if (typeof value === 'number') {
UIManager.dispatchViewManagerCommand(
findNodeHandle(riveRef.current),
ViewManagerMethod.setNumberState,
[triggerStateMachineName, inputName, value]
);
}
},
[]
);
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in Rive.tsx at setInputState and inspect the riveRef lifecycle around findNodeHandle and UIManager.dispatchViewManagerCommand. Reproduce the release APK crash if possible, then verify that unavailable handles are handled safely and valid state updates still dispatch without crashing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react-native, typescript
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100