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:
When popping from Screen B to Screen A though;
Yes.
@mrousavy Are you listening to these commands in screen B?
@guyca I have listeners on both screens, none of them trigger on pop. ๐
@mrousavy I'm unable to reproduce in the Playground app. Please repro as this could be an issue with the hooks library or a timing issue related to component unmount.
did you try it on iOS? I'll try creating a quick repro later
Yup, tried on iOS and a global command listener.
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.
The issue has been closed for inactivity.
Most helpful comment
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.