Command event callback not being invoked on popping

🐛 Bug Report

  useNavigationCommand(
    useCallback(() => {
      console.debug(`${componentId} on navigation command!`);
      canNavigate.current = false;
    }, [componentId])
  );
  useNavigationCommandComplete(
    useCallback(() => {
      console.debug(`${componentId} on navigation command complete!`);
      canNavigate.current = true;
    }, [componentId])
  );

this uses the react-native-navigation-hooks package

Per docs, this command should be called on every command:

The commandListener is called whenever a Navigation command (i.e push, pop, showModal etc) is invoked.

In my case, when pushing from Screen A to Screen B, the order of execution is the following:

  1. First callback is invoked
  2. Navigation animation happens
  3. Second callback is invoked

When popping from Screen B to Screen A though;

  1. First callback is invoked
  2. Navigation animation happens
  3. nothing

Have you read the Contributing Guidelines on issues?

Yes.

Platform

  • iOS
  • Android (not yet tested!)

1 possible answer(s) on “Command event callback not being invoked on popping

  1. This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
    If you believe the issue is still relevant, please test on the latest version and report back. Thank you for your contributions.