Skip to content
This repository has been archived by the owner on Feb 8, 2020. It is now read-only.

Commit

Permalink
fix: don't apply action to an unrelated router
Browse files Browse the repository at this point in the history
  • Loading branch information
satya164 committed Aug 7, 2019
1 parent 6e7bb6f commit e1d7333
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/core/src/useOnAction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ export default function useOnAction({
visitedNavigators.add(state.key);

if (targetForInternalDispatching === undefined) {
if (typeof action.target === 'string' && action.target !== state.key) {
return false;
}

let result = router.getStateForAction(state, action);

// If a target is specified and set to current navigator, the action shouldn't bubble
Expand Down

0 comments on commit e1d7333

Please sign in to comment.