Replies: 1 comment 3 replies
-
|
Hi, that is a good question. This patch is needed in order to intercept |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I've noticed that Wouter reassigns 'window.history.pushState' and 'window.history.replaceState'.
On first thought, it seems like this is quite sensitive to the order in which libraries load, one could for example store
const pushState = window.history.pushStatein some closure before Wouter patches it. Doing this withwindow.history.gocauses an illegal invocation error but it doesn't seem that way withpushState.So is there anything to lose from creating a wrapper around
window.historyinstead of patching it? Thenavigatefunction is exported anyway, so I don't think it would change anything to have a wrapped history object in its closure. This is the way react-router does it, seecreateBrowserHistory().What do you think? Did I miss something that's only possible with the patching method? Thanks!
Beta Was this translation helpful? Give feedback.
All reactions