For anyone working with the latest version of next.js more specifically next.js 15 or above will now need to know that all dynamic API's are asynchronous, thus for any operation requiring accessing the fields of the params or searchParms needs to be handled as an asynchronous operation. Example: Before: function ProductID({ params, }: { params: { productId: number } }) { const { productId } = params return Product ID: {productId} } export default ProductID After: async function ProductID({ params, }: { params: { productId: number } }) { const { productId } = await params return Product ID: {productId} } export default ProductID you will now need to await the params object as well.
@MAR-kh4ed3 ай бұрын
thanks brother !! Was searching for the solution
@technomad1233 ай бұрын
@MAR-kh4ed you're welcome😄
@xboy23742 ай бұрын
thanx bro
@technomad1232 ай бұрын
@@xboy2374 you're welcome
@Jamie_11442 ай бұрын
Life saver, spent ages trying to fix this error then read your comment! Thank you!
@billb13655 ай бұрын
Outstanding tutorial! I first watched the lessons and now watching a second time while coding in parallel. Thanks for developing such exceptional content.
@Codevolution2 ай бұрын
Thank you for the support!
@ONEHLOFIOCHIOCHEME5 ай бұрын
Vishwas is a gifted teacher and educator. You are a gift to mankind dear Vishwas.
@uquantum8 ай бұрын
Thanks so much❤ I’d moved so quickly to astro (ssr) a couple years ago, but now I have a next.js project, so I really appreciate your presentation style and the content to get me up to speed.
@AjikwuC.Wilson Жыл бұрын
Thanks. I'm following this course as soon as they drop. Promise to finish it with you. This is great
@Usama-Tanoli10 ай бұрын
so as you might finished this could you tell me how is this
@NishantCosmos27 күн бұрын
Wow your explanations are clear as crystals. I love it. Thankyou for these tutorials.
@SupunNimantha2 ай бұрын
When you destructure route parameters, it's better to have an interface defined to accept route parameters specific to that page especially when you have multiple properties. It's much clearer and the code is neat.
@shubhaverma56977 ай бұрын
Wow. Amazed by the content you provided in 7 minutes. I must have tried to learn about dynamic routes from so many resources, never quite understood it until now.
@euroclydon7883 Жыл бұрын
Your explanations are top notch
@omozemojeaugustine35299 ай бұрын
Am following the series thanks for breaking this down to this level
@md.Alamin-ej6ro8 ай бұрын
Damn THIS was too good, it helps me a lot i was searching for this type of content but everyone just explained it in a more difficult way , anyway it was damn good to understand the basics of the dynamic routes. Thanks a lot..
@riavi11 ай бұрын
Thanks! This cleared up what my instructor meant by dynamic routes, I didn't get it in class.
@latifurrahman264811 ай бұрын
this course helps me very much. you are the best instructor
@misalambasta5 ай бұрын
Those who are wondering where the params come from. The folder name [productId] will pass as a params in page.tsx file of the same folder.
@kuldeepdebnath47872 ай бұрын
BEST TUTORIAL OUT THERE. TYYSMM
@koketsophiri17533 ай бұрын
Gold mine of a course😭❤
@syedakashish5913 Жыл бұрын
explanation is so good.And it seems like john the don it teaching.
@bhn199711 ай бұрын
Thanks for your guides. Exactly what I wanted to render!
@emmanuelkpogo93196 ай бұрын
Great tutorial. Very comprehensive.
@auricaputri76647 ай бұрын
great tutorial video, my first day learning your course!!
@isagive6 ай бұрын
תודה רבה, הסבר ענייני ומקצועי. 👍
@inibudi4233 Жыл бұрын
Thank you for step-by-step tutorial, very helpful
@thespiritninja116 ай бұрын
THIS HELPED SO MUCH! Thank you 🫡
@shresthagaurab2193 Жыл бұрын
Thanks u so much step by step , it's very helpful
@jeffreyndukwe3869 Жыл бұрын
You are doing a great and wonderful job. Nice teaching
@yinonelbaz5309 Жыл бұрын
You are doing a great and wonderful job!
@GREENTEACODES3 ай бұрын
Thank you brother for such amazing content
@rohit_dev Жыл бұрын
I am going to finish this series with you 🙌
@josatienganh8 ай бұрын
Thank you so much for the guide! ❤
@sejeminecraft111 ай бұрын
Thank you so much. Short and precise, extremely helpful!
@Ezzgamezzz6 ай бұрын
Well explained 👍🏻👍🏻
@joja2174 Жыл бұрын
bro explained a 2 hours lecture in 7 mins
@king_james_official7 ай бұрын
no
@mzohaib274 ай бұрын
actually bro is explaining very good... those who took 2 hours for this.. they are paid courses.... their goal is only to take money.... nextjs course... then nextjs advanced course... then nextjs project learning course etc..... that's why they are taking 2 hours on this.... bcz if they teach everything in one course who will buy second...
@joja21744 ай бұрын
@@mzohaib27 imo paid courses are very focused on giving EVERYTHING the good bad and ugly, the useful, useless and good to know, so they are not time efficient but definitely worth it, at least the good ones some things they tend to over explain which why i watch channels like this, straight to the point
@jonathanguerrero599111 ай бұрын
Dynamic routs information start at minute 4:00 all previously said is not dynamic routes.
@DushyantJoshi11 ай бұрын
Just Awesome. Thanks for this.
@GerardoAG6 ай бұрын
you are a genius bro, thaks
@yipmong9 ай бұрын
Sir, words can not express our appreciation to your short and fully concised tutorial, we are very grateful for this. i watched a 3 hours tutorial but couldnt understand fully but yours of less than 10 mins i feel like a pro in this thank you so much for all you do sir❤❤❤
@최재혁-k6j Жыл бұрын
so useful teaching! Thanks
@ViniciusRodrigues-st8mw4 ай бұрын
Thank you very much Sir!
@aakashyadav6228 Жыл бұрын
Bro, please continue with the series.
@TheKauddin2 ай бұрын
Where did i mistake? export default function ProductDetails({params}:{ params:{productid:string}; }) { return Product Details of {params.productid}; }
Thank you! Where did you find it? There is no this info in documentation I think. Only with the help of your video I managed to finally do dynamic routes ( params especially are never mentioned in documentation, or I am stupid I don;t know)
@omexaapp30628 ай бұрын
certainly u are the best.
@asifnewaz47711 ай бұрын
Thanks bro! You are so cool!
@rickyanchores4464 Жыл бұрын
Great tutorial!!
@ShivamSahu-l6c3 ай бұрын
Amazing
@2u841r5 ай бұрын
Thank you.
@andrewberrio737411 ай бұрын
Thank you sir
@luisr26626 ай бұрын
Amazing!
@Yuuffyy Жыл бұрын
Hey Codevolution & watchers, In your dynamic routes we're using params. Is there any difference to your usage and type declaration compared to NextJS useParams für dynamic routes? In their docs they create a variable with const params = useParams (and import it). Thanks for your videos!
@beybell10 ай бұрын
If someone gets an error, the id does not appear in the text on the page or next shows an error, check whether you wrote the ID correctly in the ProductId folder. In the folder name, the first letter I must be capitalized product Id
@Kevin-ft1xe10 ай бұрын
Thanks mate
@MucahitCanbey Жыл бұрын
Thanks ✨✨
@osaka-ben9291 Жыл бұрын
thank you so much ! i was struggling with NextJs router specially with the 14.0 version because we're not using the folder "pages" anymore if i get it right.
@wojteeh10 ай бұрын
Very useful, thanks ;)
@NguyênNguyễnTrung-r3x Жыл бұрын
Thank you!
@tensorbaba76876 ай бұрын
why do we destructure params in paramerters of function component?
@minseongkim32786 ай бұрын
This video must be accepted by official docs
@mohitrathore8808 Жыл бұрын
Wonderful, keep going
@nahar830 Жыл бұрын
Thanks
@Regiomer Жыл бұрын
Does this work with js also? It renders only the "404 page not found" component in my case
@saintrivers96211 ай бұрын
Yeah, I'm having the same problem.
@Pipu7488 ай бұрын
love it
@sahandsepidar4089 Жыл бұрын
i only tought the only way to get the paramd is using hooks , i didnt know about params ; thank you
@shouryadey39113 ай бұрын
What if I need some pattern like this a-to-b-journey. where a and b can be anything. would having a folder with name [src]-to-[des]-journey works?
@NishantCosmos27 күн бұрын
Did you found out?
@its_Akhtar6 ай бұрын
Thanks a lot
@kevinchittilapilly822111 ай бұрын
Thanks for the lecture. I have a doubt. How can I add a check so that only if the productId is a number, I navigate to the right page. But if the user enters something like product/temp it does not navigate to the productid page
@ThePressend3 ай бұрын
import useRouter, then destructure your dynamic id, and check for this whether is number using Number.isInteger(), if not redirect to another url
@tsmusic9587 Жыл бұрын
NICE video
@adityarajaram3124 Жыл бұрын
I have question while deploying in next js 14 with app router (Dynamic Route) it's not supported. Do you know any way?
@iqbalali3341 Жыл бұрын
I also have the same problem, have you found a solution?
@victoragese Жыл бұрын
Same here
@HassanAKhann9 ай бұрын
Saviour
@mxttw9 күн бұрын
thanksssss
@bj0urne9 ай бұрын
My VS Code doesn't automatically format my code when I save the file like yours does... Is that an extension you're using?
@EzequielGrigolatto-lg6mz9 ай бұрын
You can use and configure prettier for that
@harshitshrivastava1149 ай бұрын
why my params.productID is showing undefined in console.log
@gboyegaoluwatobiloba85856 ай бұрын
seems using typescript is a hassle
@ailton.duarte7 ай бұрын
my layout is not working in productId, do u know why?
@JagadishL-wj6sn9 ай бұрын
How do you handle 404 page for dynamic routes
@AlexTLOU8 ай бұрын
well, lets say you are searching for that id in the database and returning its properties, then yuo can do a conditional rendering to see if your api returned the data or returned a 404 error!
@theangelofspace155 Жыл бұрын
But what happen of we try to access a outOfRange dynamic route? Do we need to build that logic so if a user is trying to go to /[100] but we only have 50 resources? Or will nextJS render a 404 - not found?
@HimanshuGogoi Жыл бұрын
u need to manually redirect it to not found else it will still attempt to show the page
@HassanMehboob-ij1cq11 ай бұрын
How I can get id in nested component?
@gettingoverit__6 ай бұрын
how to do it programmatically
@navjotsingh53034 ай бұрын
with dynamic routes i could't able to make build with static export can anyone help me with this
@zohaibafridi3522 Жыл бұрын
will it work on build?
@gabrielsouza448310 ай бұрын
Why when im ussing output: export I got the error "Page "/[ID1]/[ID2]" is missing "generateStaticParams()" so it cannot be used with "output: export" config." ??? I dont have all possible values to ID2 and ID2 to generateSTtaicParams
@EzequielGrigolatto-lg6mz9 ай бұрын
I'm getting the same issue, were you able to solve it?
@gabrielsouza44839 ай бұрын
@@EzequielGrigolatto-lg6mz the """"fix""" is downgrad tô 13.4.9 , apparently next 14 release with this bug but never fixed
@EzequielGrigolatto-lg6mz9 ай бұрын
@@gabrielsouza4483 thanks for your quick answer! unfortunately downgrade next version is not possible on my case, I'll look for other options then
@gabrielsouza44839 ай бұрын
@@EzequielGrigolatto-lg6mz I tried almost everything , almost for two weeks, but if u find a solution tell me
@rahmannurudin5003 Жыл бұрын
where's _app module in newest next.js version?
@behroozbk Жыл бұрын
best
@MALI-gj8sk4 ай бұрын
But NextJs docs says folder name should be like this: pages/products/[id].js.
@CelliumsBurner3 ай бұрын
You’re using the pages router. You should be using the app router. You’re looking at the wrong docs
@yellhtetnaing2245 Жыл бұрын
waiting for next pieces
@worldoflanguages10437 ай бұрын
what;s this error in console Warning: Extra attributes from the server: cz-shortcut-listen
@chesterxp508 Жыл бұрын
GoodJob!
@selvamkarthik9605 Жыл бұрын
😊
@Kmkn308 Жыл бұрын
waiting more videos
@manuelrosalesmaquieyra96878 ай бұрын
bestia animal idolo
@ObjectiveTruth-zm3hi8 ай бұрын
isn't TypeScript a waste of time ?
@warriors_edge8 ай бұрын
fuckin amazing, thank you
@gorkemgok931310 ай бұрын
The voice is AI. I am sure.
@AlexTLOU8 ай бұрын
nah he is just Indian 🤣🤣🤣🤣🤣🤣
@anasouardini7 ай бұрын
BRO, you've been repeating the same thing in the last 3 videos
@tienhuynh24356 ай бұрын
respect sir
@jesssdad4 ай бұрын
For me it didn't work as it didn't display the product ID after 'Details about product'. For anyone having the same issue first thing to check is that the folder is named [productId], mine was [productID] and it couldn't match/find the page. So the big lesson here is that next.js is case-sensitive. The only way I could work out how to debug it was to use postman and look at the actual response from the server which contained the following content (buried in a HTML tag) "{\"children\":[\"Details about product \",\"$undefined\"]}] 5:[\"productID\",\"1\",\"d\"] 7:D{\"name\":\"RootLayout\",\"env\":\"Server\"} 8:D{\"name\":\"NotFound\",\"env\":\"Server\"} 8:[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}" In other words the server simply returned 200 = OK as a status on a 404 page. I'm guessing this type of issue is handled in a later video?
@CelliumsBurner3 ай бұрын
If you used your common sense you’d know that js is a case sensitive language.
@yogita86810 ай бұрын
I have this created this file structure in Next js version ->14 project\[[id]] Inside page.tsx I have this code-> 'use client'; import PathwayContainer from '@/components/Pathways/PathwayContainer'; const PathwayPage = () => { const clientID = '06375fa6-999a-46a8-9d80-12e41e76aa52'; return ( ); }; export default PathwayPage; This clienID I would fetch from useselector later as of now i keep code like this. and this is the component for PathwayContainer. 'use client'; interface IPathwayContainerProps { fetchClientProjects: (clientId: string) => Promise; clientID: string; } const PathwayContainer: FunctionComponent = (props) => { const { fetchClientProjects, clientID, } = props; const [loading, setLoading] = useState(false); const [activeProjectList, setActiveProjectList] = useState([]) useEffect(() => { const getActiveProjectList = async () => { try { setLoading(true); const projectInfo = await fetchClientProjects(clientID); setActiveProjectList(projectInfo); } catch { } finally { setLoading(false); } } getActiveProjectList(); }, [clientID]) return ( {activeProjectList.map((activeProject, index) => ( {activeProject.name} ))} ); }; export default connect(() => ({}), { fetchClientProjects: actions.clients.fetchClientProjects, })(PathwayContainer); whevaver user clcik on this link which i have crated using clientID is not changed but my useeffect code runs again and again whenver user click on links. same code works fine in react. How can i solve this issue.please help.
@igorluyz_ Жыл бұрын
You are doing a great and wonderful job!
@adityarajaram3124 Жыл бұрын
I have question while deploying in next js 14 with app router (Dynamic Route) it's not supported. Do you know any way?