Co-authored-by: Alex van Andel <me@alexvanandel.com> Co-authored-by: Peer Richelsen <peeroke@gmail.com> Co-authored-by: Bailey Pumfleet <bailey@pumfleet.co.uk> Co-authored-by: Peer Richelsen <peer@cal.com> Co-authored-by: Hariom Balhara <hariombalhara@gmail.com>
14 lines
319 B
TypeScript
14 lines
319 B
TypeScript
"use client";
|
|
|
|
import { useParams } from "next/navigation";
|
|
import { useRouter } from "next/router";
|
|
|
|
/**
|
|
* This hook is a workaround until pages are migrated to app directory.
|
|
*/
|
|
export function useParamsWithFallback() {
|
|
const router = useRouter();
|
|
const params = useParams();
|
|
return params || router.query;
|
|
}
|