Skip to content

oelbaga/nextjs-dynamic-routes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

4 Ways to use dynamic routes in Next.js

This repo references four different ways to use dynamic routes in Next.js to make sure the route data gets to the page prior to trying use it.

Usage: Option 1

export default function Home() {
  const router = useRouter();
  const { name } = router.query;

  useEffect(() => {
    if (!router.isReady) return;
    //rest of code
  }, [router.query.name, router.isReady]);

  return <></>;
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published