Skip to content

Commit 77456e5

Browse files
authored
Update gatsby-browser.js
1 parent 6c440f6 commit 77456e5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

examples/using-page-transitions/gatsby-browser.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ const timeout = 250
1010
const historyExitingEventType = `history::exiting`
1111

1212
const getUserConfirmation = (pathname, callback) => {
13-
const event = new CustomEvent(historyExitingEventType, { detail: { pathname } })
13+
const event = document.createEvent("CustomEvent");
14+
event.initCustomEvent(historyExitingEventType, false, false, { detail: { pathname } });
1415
window.dispatchEvent(event)
1516
setTimeout(() => {
1617
callback(true)
@@ -85,4 +86,4 @@ exports.replaceComponentRenderer = ({ props, loader }) => {
8586
return undefined
8687
}
8788
return createElement(ReplaceComponentRenderer, { ...props, loader })
88-
}
89+
}

0 commit comments

Comments
 (0)