mirror of
https://github.com/hanzoai/calendar.git
synced 2026-09-24 22:42:24 +00:00
* fix: Flakyness on pages that use a hard refres Signed-off-by: zomars <[email protected]> * Update Shell.tsx --------- Signed-off-by: zomars <[email protected]>
13 lines
360 B
TypeScript
13 lines
360 B
TypeScript
import { usePathname, useSearchParams } from "next/navigation";
|
|
import { useMemo } from "react";
|
|
|
|
export function useAsPath() {
|
|
const pathname = usePathname();
|
|
const searchParams = useSearchParams();
|
|
const asPath = useMemo(
|
|
() => `${pathname}${searchParams ? `?${searchParams.toString()}` : ""}`,
|
|
[pathname, searchParams]
|
|
);
|
|
return asPath;
|
|
}
|