From 837e396065fd2f107447ded1731c5e99cbe83755 Mon Sep 17 00:00:00 2001 From: JLarky Date: Thu, 23 Nov 2023 14:30:30 -0700 Subject: [PATCH] fix src/htmx.js(3842,25): error TS2769: No overload matches this call. --- src/htmx.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/htmx.js b/src/htmx.js index 1f0709d75..b259669dd 100644 --- a/src/htmx.js +++ b/src/htmx.js @@ -3827,7 +3827,9 @@ return (function () { internalData.xhr.abort(); } }); - var originalPopstate = window.onpopstate; + /** @type {(ev: PopStateEvent) => any} */ + const originalPopstate = window.onpopstate ? window.onpopstate.bind(window) : null; + /** @type {(ev: PopStateEvent) => any} */ window.onpopstate = function (event) { if (event.state && event.state.htmx) { restoreHistory();