Maintain existing overlay state when setting hash (#10495)

This commit is contained in:
Nicolas Mowen 2024-03-17 06:29:59 -06:00 committed by GitHub
parent cf6ef84271
commit 4e8600a0ef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -76,7 +76,7 @@ export function useHashState<S extends string>(): [
if (!value) {
navigate(location.pathname);
} else {
navigate(`${location.pathname}#${value}`);
navigate(`${location.pathname}#${value}`, { state: location.state });
}
},
// we know that these deps are correct