pkellner / pluralsight-course-server-side-rendered-react-nextjs

This is the repository associated with the Pluralsight course "Building Server-side React Apps"
https://app.pluralsight.com/library/courses/building-server-side-rendered-react-apps-beginners
MIT License
81 stars 102 forks source link

[Question] Why avoided using Dynamic Routes while creating Server-side-Rendering-Landing-Page-with-Query-Params? #84

Open omareg94 opened 3 years ago

omareg94 commented 3 years ago

Is there a reason why you avoided using Dynamic Routes in lesson 5.7. Server-side-Rendering-Landing-Page-with-Query-Params and created custom server.js while Dynamic Routes seems simpler?

pkellner commented 3 years ago

I agree that dynamic routes are simpler. I probably picked query params instead because they give you a lot more flexibility but certainly, for my example you could use dynamic routing. In real world apps, I've found that it's easy to get boxed into a corner with dynamic routing. Things like checking null conditions and conditionals around dynamic routing can be problematic.

omareg94 commented 3 years ago

Thank you.