Questions tagged [nextjs-dynamic-routing]

In Next.js, dynamic routes are defined by placing the parameter inside square brackets ([]) in the page file name. For example, if you have a dynamic route for displaying a user's profile, you can create a file called [username].js. The username inside the brackets is the parameter that will be used to generate dynamic pages.

To handle dynamic routes, Next.js provides a special component called getServerSideProps or getStaticProps. These functions allow you to fetch data based on the dynamic parameter and pass it as props to the page component.

188 questions
-1
votes
1 answer

Dynamic Links with url properties not passed while routing in nextjs13

I'm learning nextjs using book "Building React Apps using server-side rendering" In this I'm building basic react app with index page link to about page. The project package.json - { "name": "my-next-app", "version": "1.0.0", "description":…
user51
  • 8,843
  • 21
  • 79
  • 158
-1
votes
1 answer

How to pre render secured APi's on server in Next js

I have a project which includes to fetch data on multiple pages but all of the api's are secured except the first api which will fetch the data for the home page that is unsecured. Rest all the API's are secured via Azure AD. I have moved from react…
-1
votes
1 answer

cannot access files inside folder in next js

i am working dynamic routing in next j s,and folder structure is like pages: _app.j s index.j s main_Page: cart: [...cart_Component.j s] about: [...about_Component.j s] [[...index]].j s and here my [[...index]].j s file is dynamic…
-1
votes
1 answer

Next Js Home Page is giving me 404 Page not found After Next JS upgrade to Next JS 11.1.2

After upgrading my Next.JS version to Next 11.1.2 My HomePage is redirecting me 404 not found .While Other Routes are working as expected. I do not have any thing specific in my app.js that sould block my home page . Any help would be highly…
Payel Dutta
  • 742
  • 10
  • 23
-2
votes
1 answer

path.startsWith is not a function in next js

Why it is showing me path startsWith error. I'm trying to send the amount to the path import { useRouter } from 'next/navigation' const checkoutHandler = ()=>{ router.push({ pathname: '/checkout/[amount]', query:…
sohaib
  • 574
  • 5
  • 16
1 2 3
12
13