Skip to content

Commit

Permalink
chore: add __isDvaPatch args for the initial history listen handler c…
Browse files Browse the repository at this point in the history
…all (#2511)
  • Loading branch information
sorrycc committed Apr 11, 2023
1 parent 64996cb commit 554827e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/dva/src/index.js
Expand Up @@ -122,7 +122,9 @@ function patchHistory(history) {
(cbStr.indexOf('.inTimeTravelling') > -1 &&
cbStr.indexOf('.inTimeTravelling') > -1 &&
cbStr.indexOf('arguments[2]') > -1);
callback(history.location, history.action);
// why add __isDvaPatch: true
// since it's a patch from dva, we need to identify it in the listen handlers
callback(history.location, history.action, { __isDvaPatch: true });
return oldListen.call(history, (...args) => {
if (isConnectedRouterHandler) {
callback(...args);
Expand Down

0 comments on commit 554827e

Please sign in to comment.