Skip to content

Commit 821a431

Browse files
committed
fix window
1 parent d084f99 commit 821a431

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

router/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ export const ReloadContext = createContext(async (): Promise<void> => {});
8888
* Returns a stateful value which bounded to route, and a function to update it.
8989
* Note that the value won't be updated across components.
9090
* So you should use this only in top-most component
91-
* @experimental
9291
* @param key unique key
9392
* @param initial initial value
9493
* @returns value and setter
@@ -98,7 +97,7 @@ export function useRouteState<T extends {}>(key: string, initial: T) {
9897
const routeState = history.state ?? {};
9998
history.replaceState({ ...routeState, [key]: newvalue }, "");
10099
return newvalue;
101-
}, (window?.history?.state?.[key] ?? initial) as unknown as T);
100+
}, (globalThis.history?.state?.[key] ?? initial) as unknown as T);
102101
}
103102

104103
export const RouterHost = ({

0 commit comments

Comments
 (0)