Code Block
1 componentEverything tagged Code Block, with notes on how each one works.
That is everything tagged Code Block.
Pick another tag, or go back to all components.
Removed: import { useRouter } from "next/router";
export default function Search() {
Removed: const router = useRouter();
Removed: const term = router.query.q;
return <p>Results for {term}</p>;
}
Added: "use client";
Added: import { useSearchParams } from "next/navigation";
export default function Search() {
Added: const params = useSearchParams();
Added: const term = params.get("q");
return <p>Results for {term}</p>;
}