Managing state in React sounds simple in theory, just use the useState hook. And if you need more, you can use an external state manager like Redux or React Context. But what happens if you refresh the page? The state is lost. What happens if you share the URL? The state is lost. In this video, I'll show you how to implement URL state in your Next.js application, both natively and with the nuqs package. Enjoy!
📸 Screen Recording Software: https://dub.sh/eDa47SO
🚀 Checkout Cal for Free: https://dub.sh/FAuffAy
👨🏻💻 GitHub Repository: https://github.com/ski043/state-url-vs-client-ytr
🌍 My Website: https://janmarshal.com/
✅ Follow me on X: https://x.com/janmarshaldev
📧 Business ONLY: [email protected]
Timestamps:
00:00 Intro
01:00 Client-Side State
04:50 URL State
14:20 Issue with Type Safety
15:30 URL State with Type Safety
22:30 When to Use What