This is Why I no longer useState in Favor of URL in React

preview_player
Показать описание
If you don't know already, you can use the URL to keep the state of your React application. And it's as easy as using useState(). Yes, you're hearing that right!! In this video, we'll explore an awesome library that will allow you to set and retrieve state from the URL Search params very easily right inside your React component with hooks.

🎉Our Newsletter is live! Join thousands of other developers

⭐ Timestamps ⭐
00:00 Intro
00:51 Why Keeping the state inside the URL?
03:16 Using the useQueryParams hook
09:08 Trying the E-commerce Search
10:13 Restore values from the URL into the State

-- Special Links

✨ Join Figma for Free and start designing now!

👉 ✨ Join Figma For Professionals And Start Designing with your Team ✨

🧭 Build Login/Register API Server w/ Authentication | JWT Express AUTH using Passport.JS and Sequelize

🧭 Turn Design into React Code | From prototype to Full website in no time

🧭 Watch Tutorial on Designing the website on Figma

🧭 Watch Create a Modern React Login/Register Form with smooth Animations

🧭 Debug React Apps Like a Pro | Master Debugging from Zero to Hero with Chrome DevTools

🧭 Master React Like Pro w/ Redux, Typescript, and GraphQL | Beginner to Advanced in React

🧭 Learn Redux For Beginners | React Redux from Zero To Hero to build a real-world app

🧭 Introduction to GraphQL with Apollo and React

👉 Personal Links:

Made with ❤️ by Coderone
Рекомендации по теме
Комментарии
Автор

I always wondered how they do this, Thank you *-*

oussamasethoum
Автор

Damn, my backend ass was doing this manually. Didn't know there was a hook

spicynoodle
Автор

Neat!

Refresh is bad example here. As refresh now does nothing - it returns you in same page state as before.
Better example is sharing url at specific state.

coolemur
Автор

Such a good/detailed explanation! I was about to implement a filter/search function on my bug tracker project, super helpful!

juanmacias
Автор

Pls which api are u using for the products?

AlameenAdeyemi
Автор

pretty cool, do you have a link to git code ?

amoghphadke
Автор

What happens when you want to use throttling with searchbar?

hemanthkumarmaddi
Автор

Dude please...is there a github link for this repository?

glengraham
Автор

Or you could just use tanstack router...

YourModdedControllers