Kevin Powell - CommunityKP-C
Kevin Powell - Community•2y ago•
4 replies
celine

Next JS routing got me confused

Hey, I have this simple link in my component but im kinda confused with the routing.

<Link key={product.id}
data-type={product.type}
data-product={product.name}
href={`/shop/product/${product.name
.toLowerCase()
.replace(/\s+/g, '-')}`}
className={s.card}
>


What folder do I need to create and how do I match .toLowerCase and .replace methods in the folder name and shall I? I've read the docs in next js for this https://nextjs.org/docs/app/building-your-application/routing/dynamic-routes but can't figure out what shall I do 😦
image.png
Dynamic Routes can be used to programmatically generate route segments from dynamic data.
Routing: Dynamic Routes | Next.js
Was this page helpful?