UNPKG

@xo-union/tk-component-header-nav

Version:
10 lines 350 B
import _globalThis from "@babel/runtime-corejs3/core-js/global-this"; import { useState } from "react"; import { useLayoutEffect } from "@tkww/orion-web-lib-react"; export const useLocation = () => { const [location, setLocation] = useState({}); useLayoutEffect(() => { setLocation(_globalThis.location ?? {}); }, []); return location; };