rive-app / rive-app/rive-react-native

Error: dispatchViewManagerCommand: found null reactTag, js engine: hermes

Open
#295 5 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.