Next JS tutorial in Hindi #13 Catch-all Segments of Route in Next.js
ฝัง
- เผยแพร่เมื่อ 5 ก.พ. 2025
- Instragram Id : code.steps
In this next js tutorial video, we learn about common layout in next js 13.4 in Hindi. this course is made by Anil Sidhu in the Hindi language.
points of video
What are the Segments of the Route?
How to get all segments of Route
Interview Question.
The task for you.
Get Route Name from url?
How to get all segments of Route?
github.com/ani...
React js Latest Playlist in Hindi: • React tutorial for beg...
inst id: @code.steps
gr8 job,
no need of "use client", it works without of it.
Here is 2 way to use map function to take all data.
1)
Lectures:
{params.lecture.map((segment, index) => (
{segment}
))}
2) let URL = params.lecture.map((segment, index) => (
{segment}
))
const joinedString = params.study.join('/');
{joinedString}
Hmm, Looking forward to more videos
We are receiving multiple segments from this code. We run the loop and get the following output:
'use client';
const Lecture = ({params})=>{
return (
welcome
{params.lecture.map((items) => {
return listing: {items};
})}
)
}
export default Lecture;
learning from you best teacher love from nepal
take love from BD
Thank you and please take love from India :)
its very helpful for who watching old playlist code
You aare the best
Very helpful video ❤
I only let you know that there is no need of using 'use client' for the dynamic routing and using params, it works on server side too but why it does not console anything because when it is being used on server side, it console everything on server side, in our case that is terminal, when we console on client side, it is consoled on browser.
right bro I have noticed this mistake 🙂
Very helpful video.
But please upgrade your mic quality 🎤 like chai aur code😇
nice
thank you sir
Most welcome
Nested Dynamic Routes pe bhi vedio ban do brother
How to use separate/dynamic metadata based on the slug?
I am getting type error here
TypeError: Cannot read properties of undefined ( reading '0')
we can fetch data dynamicaly like
lecture{params.lecture}
without using array [ ] thats all
thanks a lot
2 segment ke bad agr access krna hai to ek to static tareeka hai jese apne kiya hai {lecture[0]} like {lecture[3]}, {lecture[4]} etc
Ya fir hum map ka use kr sakte hai or map ki help se jitne bhi segments aane wale hai unko dynamically show krwa sakte hai, Correct?
yes, correct.
jis kisi ko bhi error araara hai params mai aisa kariya aur sir kya yeh method correct hai
import React from 'react'
async function Lecture({params}) {
let resolved = await params
console.log(resolved.lecture)
return (
{resolved?.lecture[0]}
{resolved?.lecture[1]}
)
}
export default Lecture
bhai mera params ki jgh kuch or likh kr nhi chlta, vo undefined rehta hai variable jo bhi likhu me params ki jgh
in my case need to" import {useParams} from 'next/navigation' " at [ time stamp 7.10 ] ,,,otherwise not get params
slam sir
what will you make a project in Next JS after complete the playlist videos please gave answer
param mein data kis tarah dalna ha
Can't we use query parameters?
by using foreach loop we can use all segments
sir kitni baki hai video abhi q ki me abhi project pr hu live to meko smjh nhi aa rha hai
where we will use this?
By this you can display multiple level of sagments.
const { comments } = params;
{comments.map((comment, index) => (
Level: {comment}
))}
What's the use of this part 🧐🧐 if we don't want to show more than what have we created. And some how it is just returning our own keywords 😒