Next.js Discord

Discord Forum

how to get params from link to another page I need the id from

Unanswered
Thai posted this in #help-forum
Open in Discord
ThaiOP
Im trying to get the id of the data I fetch from an API on click on the particular element so it redirects to a whole new page that shows details of that id.
I don't know how I'm going to pass the id to my other page.jsx file in my [movieid] directory.
Can y'all help me out #announcements #resources #help-forum #discussions

4 Replies

Stejneger's Petrel
Just try

import { useRouter } from 'next/navigation'
Ring-billed Gull