The Best React State Management Solution Has Been There All Along

We are all used to using the useState hook to manage state in React. We may even turn to more powerful state management libraries like Redux, but in reality the best state management for UX is most likely just the browser URL. In this video I will explain why that is and how you can easily swap to using the URL for state management.
📚 Materials/References:
React Router Tutorial: • Learn React Router v6 ...
Zod Tutorial: • Learn Zod In 30 Minutes
🌎 Find Me Here:
My Blog: blog.webdevsimplified.com
My Courses: courses.webdevsimplified.com
Patreon: / webdevsimplified
Twitter: / devsimplified
Discord: / discord
GitHub: github.com/WebDevSimplified
CodePen: codepen.io/WebDevSimplified
⏱️ Timestamps:
00:00 - Problem
00:45 - Solution With React Router
03:51 - What To Watch Out For
#ReactRouter #WDS #ReactJS

Пікірлер: 297

  • @djSeakDigital
    @djSeakDigital9 ай бұрын

    We've really come full circle. State belongs in the URL. That's the power of a website. This reminds me of the MVC days.

  • @JayDoge

    @JayDoge

    9 ай бұрын

    Depends on the case. For search parameters yes, it improves UX and the ability to share the page with your filters.

  • @muratcemyalin

    @muratcemyalin

    9 ай бұрын

    thats my response when i first saw SSR.. going back full circle to PHP

  • @jrmc732

    @jrmc732

    9 ай бұрын

    That never changed a part of the state always belonged to the URL, the issue is young people never learned it right in the first place, that's not a framework issue that's a learning issue.

  • @turolretar

    @turolretar

    9 ай бұрын

    All of this exists so that the top developers can earn fat stacks of money. And even those at the bottom can get some crumbs and scraps. It’s utterly pointless to be real, to the point of it being so ridiculous, that the whole point was missed by a mile from the start

  • @omomer3506

    @omomer3506

    9 ай бұрын

    Something something state us stored in the balls..... But yeah we have come full circle. But just to philospoize for a second, now we know why things were done in a certain way and its benefits But more so i keep thinking , are all these techniques just the best it could have ever been given the state of how we use the web and internet,

  • @developer_hadi
    @developer_hadi9 ай бұрын

    Server actions, and now this, we're really going back and thinking we're inventing something new

  • @allahrakha1309

    @allahrakha1309

    9 ай бұрын

    For the sake of reactivity in UI , we are going to 90s era.

  • @ScytherDOTA

    @ScytherDOTA

    9 ай бұрын

    My thoughts exactly 10 seconds into video. "iF yoURe uSiNg StaTe uR doiNg iT WrOnGNG XD". cringe

  • @robadobdob

    @robadobdob

    9 ай бұрын

    As a web dev from the 90’s, it’s amusing seeing all these videos acting like they discovered something new.

  • @jfgabriel

    @jfgabriel

    9 ай бұрын

    100% agree.

  • @justpatrick_

    @justpatrick_

    9 ай бұрын

    ​@@ScytherDOTAits the goto for react "experts"

  • @debanjandey64
    @debanjandey649 ай бұрын

    We recently worked on this a lot of times in the project we are currently working, where we require to implement a filter for a set of records. The values are taken from a form and set to URL, and an useEffect was added for change in search params to call the necessary API. A lot of hassle was required to put the values from the URL back to the form when the page is refreshed.

  • @sbsalil
    @sbsalil9 ай бұрын

    Thanks for the video. Two days back I want through a detailed tutorial to build a simple Contacts from using the Remix framework; So watching this video I kind of revisited the concept of querystring (search params) approach of saving state.

  • @ozzyfromspace
    @ozzyfromspace9 ай бұрын

    Awesome video! I use this technique for all sorts of things, but never thought about the url replace optimization, that's clever. I have a hook (NextJS) that handles this for me, I'm just gonna add url replacement logic. Thanks, Kyle!

  • @adanos2006
    @adanos20069 ай бұрын

    it's not the first time when i working on something and Kyle gives me an advise i need. thanks for help

  • @TakeOnMe5
    @TakeOnMe59 ай бұрын

    Just note, there are limits for the maximum allowed URL length in the address bar of browsers. This varies vastly between browsers.

  • @risitas5874

    @risitas5874

    9 ай бұрын

    Yes, for this reason it's often better to store this state on a backend and just return a short ID that you append to the URL.

  • @TakeOnMe5

    @TakeOnMe5

    9 ай бұрын

    @@risitas5874 Not sure if that's often better but at least that would be one way, yes.

  • @nathanmurphy8211

    @nathanmurphy8211

    9 ай бұрын

    ​@@risitas5874yep, I'm surprised this wasn't mentioned in the video.

  • @MasayaShida

    @MasayaShida

    9 ай бұрын

    ​@@risitas5874could you give a simple example of that please. Thank u

  • @zakariabougroug2687

    @zakariabougroug2687

    9 ай бұрын

    Or to use a state management tool for unauthorized users

  • @appuser
    @appuser9 ай бұрын

    Converted my project over to this approach last night. It was the solution I didn't even know I needed. Thanks! I need to do some refactoring now as this approach results in some repetitive snippets of code since I have a few panels you can switch between and I want all search terms to be stored in the URL.

  • @angelicking2890

    @angelicking2890

    9 ай бұрын

    yeah I was looking for something like this for filtering.

  • @luker8874
    @luker88748 ай бұрын

    Great Vid! Short and straight to the point

  • @guideguts
    @guideguts9 ай бұрын

    thank you for simplifying the web for me, now I can start building my dream project

  • @hmswrth
    @hmswrth9 ай бұрын

    I just recently implemented this on one of the projects. Quite useful!

  • @MayankMishra-oy5xe
    @MayankMishra-oy5xe9 ай бұрын

    A small Feedback:- Your videos are indeed amazing but it would be better if you make videos keeping in mind about production level code and real world programming as this method in the video is only applicable to my "contact us" form. But generally all other forms I have worked on are not simple and doesn't only contain 2-3 text field. The point here I want to make is I like you explanation and that is why I need you to make some intermediate to advance videos about production and real world project programming. Keep going.

  • @isyedaliraza

    @isyedaliraza

    9 ай бұрын

    If he does it the tutorial video will be 10 hours long

  • @MayankMishra-oy5xe

    @MayankMishra-oy5xe

    9 ай бұрын

    @@isyedaliraza I mean like people who are working and have exp. of 2-3 years needs some brief but not very literal videos on real production level programming stuffs as they can watch 20-30 minutes of content each day.

  • @someonewhowantedtobeahero3206

    @someonewhowantedtobeahero3206

    9 ай бұрын

    He publishes those in the form of courses, and you gotta buy them. Quality comes at a price

  • @MayankMishra-oy5xe

    @MayankMishra-oy5xe

    9 ай бұрын

    @@someonewhowantedtobeahero3206 I know about it but I think you haven't seen the course catalogue or my feedback comment. The courses he sells are for beginners but not for intermediate to advance level.

  • @DryBones111

    @DryBones111

    9 ай бұрын

    @@MayankMishra-oy5xeSurely if you have 2-3 years experience you would know how to translate a concept shown in a simple example to something more complex.

  • @runonce
    @runonce9 ай бұрын

    I'm happy to see all the hype search params is getting!

  • @Nekroido
    @Nekroido9 ай бұрын

    I totally forgot about this hook! I recently faced similar dilemma with my custom data table component, but didn't have the time to look into it. I already use Zod and React Router, so it's going to be a piece of cake.

  • @akasharora4944
    @akasharora49449 ай бұрын

    Loved the approach thank you:)

  • @subhamaydatta2413
    @subhamaydatta24139 ай бұрын

    Great topic to explore!

  • @stevelai69
    @stevelai699 ай бұрын

    Thanks for your video, and make me think more about usage about it.

  • @sugo8920
    @sugo89209 ай бұрын

    very nice, i'll def use this for my projects

  • @stoggys
    @stoggys9 ай бұрын

    Great short video! Cheers!

  • @gyros9162
    @gyros91628 ай бұрын

    Thanks! It is useful in Next.js server components when you need some state but don't want "use client"

  • @josprimasihombing9902
    @josprimasihombing99029 ай бұрын

    Thankyou, great explanation.

  • @motoboy6666
    @motoboy66669 ай бұрын

    Nice, simple and clear sir

  • @dfshoikot5904
    @dfshoikot59049 ай бұрын

    great work bro. learned a new thing

  • @mikutaa
    @mikutaa2 ай бұрын

    Awesome explanation 🙏

  • @nfaical3
    @nfaical39 ай бұрын

    Thanks, this is really a good idea 👍

  • @electricindro2236
    @electricindro22369 ай бұрын

    Great concept!

  • @alexanderhergert875
    @alexanderhergert8759 ай бұрын

    cool, will use that in the current project ;)

  • @IvanRandomDude
    @IvanRandomDude9 ай бұрын

    Great but come on, this is how search pages were made 15-20 years ago during Vanilla PHP era. Query params in url. Sometimes I feel we (on the web) "rediscover" old ways of doing things and pretend we invented something revolutionary.

  • @Andreas_Mann

    @Andreas_Mann

    9 ай бұрын

    Yeah true. And often this is just completetely unneccessary too. React is already a mess without all these bells and whistles. And having the URL update in real time is just a no-no for me.

  • @ItisOsos

    @ItisOsos

    9 ай бұрын

    Same with the "new" server side rendering. Those thoughts are the problem of new developers (including me of course). We don't usually know how things worked before react, angular and vue. So we must be cautious with what we said and listen to the people with many years of experience.

  • @JamesW6179

    @JamesW6179

    9 ай бұрын

    That's why it's "Has Been There All Along".

  • @gosnooky

    @gosnooky

    9 ай бұрын

    Yup. It's like this startup idea someone had about Spotify, but selected playlists playing on "channels", and people were like "Congratulations. You've just invented radio".

  • @developerAKX

    @developerAKX

    9 ай бұрын

    I have been working in react for 5 years but I am using the URL from the start

  • @dantemuniztorres6691
    @dantemuniztorres669121 күн бұрын

    Que buenos videos chabón!!!❤

  • @katarzynakrawczyk6861
    @katarzynakrawczyk68615 ай бұрын

    Awesome video!

  • @petarkolev6928
    @petarkolev69289 ай бұрын

    Amazing video!

  • @denispepper2830
    @denispepper28309 ай бұрын

    Thanks! Very nice!

  • @buddy.abc123
    @buddy.abc1239 ай бұрын

    I love it when we keep going in circles

  • @emmanuelameyaw5686
    @emmanuelameyaw56869 ай бұрын

    Man, thanks for sharing!!

  • @ankanroy2
    @ankanroy29 ай бұрын

    Bytegrad yt channel uploaded a video on the same topic a few days ago yeah it's good to use the query parameter he shows some more cool techniques with Nextjs btw nice video

  • @personzen8028

    @personzen8028

    9 ай бұрын

    That's what i noticed too

  • @TariqSajid

    @TariqSajid

    9 ай бұрын

    i was thinking the same someone already a made video on this topic

  • @vittoopugliese

    @vittoopugliese

    9 ай бұрын

    this is not the first time he upload the same topic after Bytegrad LOL

  • @kale_bhai

    @kale_bhai

    9 ай бұрын

    Content leech

  • @emadmohamed5787
    @emadmohamed57879 ай бұрын

    Great thanks

  • @piyushaggarwal5207
    @piyushaggarwal52079 ай бұрын

    i learnt a lot of these things by watching other sites like Jira work and learnt the hard way. I am thinking it is good to watch some tutorials as well. That replace: true was a new use case for me. Never took care of that.

  • @SoreBrain
    @SoreBrain9 ай бұрын

    I wish I would have known how important it is to not have possibly diverging states between backend-react-html without the mistakes that made me come to this company is conclusion myself. Search params are a nice way to reduce state complexity.

  • @dzienisz

    @dzienisz

    9 ай бұрын

    how it's better that useState?

  • @DryBones111

    @DryBones111

    9 ай бұрын

    If you send HTML to the client then you don't have to worry about this problem at all.

  • @leojacquemin1836
    @leojacquemin18367 ай бұрын

    This is actually very true. URL-driven applications are just how web was meant to be from the start and SPA fucked that up pretty bad.

  • @MubashirullahD
    @MubashirullahD9 ай бұрын

    Exactly the relevant stuff. This is premium content.

  • @MubashirullahD

    @MubashirullahD

    9 ай бұрын

    @@roodood I was building a SAAS aplication and you guessed it, using state to remember what filters applied. Making the url dirty wasnt attracted to me but it seems it was the preferred approach. It might be simple and basic but thats all thats needed. So knowledge thats relevant to work is premium.

  • @lukas.webdev
    @lukas.webdev9 ай бұрын

    Great video + Awesome Solution! 😉🔥

  • @Jackchoco
    @Jackchoco9 ай бұрын

    daxx, although i'm a backend developer only, but i know this is soso useful

  • @mohammadmahdifarvardin4150
    @mohammadmahdifarvardin41509 ай бұрын

    Amazing

  • @shivangrathore
    @shivangrathore9 ай бұрын

    Thanks

  • @vcodingdeep
    @vcodingdeep9 ай бұрын

    Nice Brother

  • @mariokrstevski8836
    @mariokrstevski88369 ай бұрын

    Did you copy this from the other youtuber?

  • @MsVsmaster

    @MsVsmaster

    9 ай бұрын

    I thought the same, the other guy showed exactly the same but with a better UI.

  • @nikilragav

    @nikilragav

    9 ай бұрын

    Who's the other guy

  • @luiswebdev8292
    @luiswebdev82929 ай бұрын

    holy shit. WHy is this something I learned only now

  • @rael_gc
    @rael_gc9 ай бұрын

    Killer and short!

  • @hardwired89
    @hardwired899 ай бұрын

    Thank you, more trick about react router v6 woahh

  • @krateskim4169
    @krateskim41699 ай бұрын

    Awesome

  • @neilmerchant2796
    @neilmerchant27969 ай бұрын

    Interesting, ByteGrad just put out a video on this a few days ago. coincidental timing, or a query prams just making a comeback right now? or another reason maybe 🤔

  • @ajfalo-fi3721

    @ajfalo-fi3721

    9 ай бұрын

    Everyone is a copycat and they're looking for views

  • @neilmerchant2796

    @neilmerchant2796

    9 ай бұрын

    @@ajfalo-fi3721 I don't want to make any assumptions and I am a big fan of WDS. and I will grant that query params are a useful tool, just strange to see it framed in this specific way Rrght after another up and coming web dev KZreadr has done the same.

  • @ukaszborkowski1073
    @ukaszborkowski10739 ай бұрын

    I knew about this hook before, but I hesitated to use it anyhow. Now as I see and understand, how this approach spices my page up. There is nothing left for me than to sit infront of my PC and to make some changes in my code.

  • @haliszekeriyaozkok4851
    @haliszekeriyaozkok48519 ай бұрын

    it's funny to write that because managing states with query parameters is the most oldest way to do it and until front-end frameworks everyone makes it with that way. This is a confession for how front-end frameworks sucks i guess.

  • @Thassalocracy
    @Thassalocracy9 ай бұрын

    Videos like this are a good reminder why PHP never dies to this day. Maybe they got it right all along - use URL as state, use sessions not JWT, use MySQL for DBs (there's Strapi in the React world for that). 😂 Anyway, thanks Kyle for this video. I still think it's quite informative for those who've never been into PHP.

  • @karlstein9572

    @karlstein9572

    9 ай бұрын

    You seem to not understand the difference between JWT and session, first one can be used cross domain, the other cannot... Also all the state cannot and should not be stored in the URL, just what you need like filters. About the database choice, it always depend on what you need and what you can afford, it's not just "use X DB", also PostgreSQL is a more advanced DB and free like MySQL/MariaDB.

  • @Thassalocracy

    @Thassalocracy

    9 ай бұрын

    Oops, somebody doesn't know tongue in cheek when he sees it... 😛

  • @karlstein9572

    @karlstein9572

    9 ай бұрын

    @@Thassalocracy Apologies if your comment was ironic, it is not really obvious.

  • @paulsisson8944
    @paulsisson89449 ай бұрын

    I’d love for you to do one of these but the state value be an array instead of a simple string. I’m struggling with how to use this process with more complex data

  • @HumayraSheikh1

    @HumayraSheikh1

    7 ай бұрын

    f

  • @sithikr1193
    @sithikr11939 ай бұрын

    It would be really great if you can teach us how to make our own rich text editor as a notion editor (example Editor.js).

  • @kaiyojimbo8814
    @kaiyojimbo88149 ай бұрын

    This is a great feature. How would we go about hiding the information displayed in the URL for security purposes?

  • @cultofleda

    @cultofleda

    9 ай бұрын

    Just don't put sensitive information into the URL in the first place

  • @aravind.a
    @aravind.a4 ай бұрын

    Good insight.. btw http should be stateless right?

  • @dzunnurainaaz
    @dzunnurainaaz8 ай бұрын

    youtube url has an encoded query param, how does it work? Is it handled in FE or BE to encode/decode it?

  • @webapple1
    @webapple19 ай бұрын

    some of the comments a bit crazy - remembering that not all of us started/even started learning pre react , I mostly now learned react - no idea about jquery and previous , i had made 1 purely html/js/css project for university but never done a project since in pure html/js/css. this to me sounds like an option but it seems that it has more specific use cases

  • @avwie132
    @avwie1329 ай бұрын

    The React world really is something different. Just wow.

  • @Raubritterr222
    @Raubritterr2229 ай бұрын

    I've never seen the `prev.get("propertyname")` in JavaScript. is it a new method? or is it a custom one? or did I miss it?

  • @j0hannes5
    @j0hannes59 ай бұрын

    thank you - well done!

  • @killd0z3r
    @killd0z3r9 ай бұрын

    Wow Homelander started teaching webdev

  • @thelaitas
    @thelaitas9 ай бұрын

    I'd like to see how y'all approach this problem when you gotta load select dropdown with i18n, everytime I had to implement something like this, it looked ugly lol

  • @omojjegomosc8211
    @omojjegomosc82112 ай бұрын

    What keyboard and switches do you use?

  • @calvinwilliams729
    @calvinwilliams7299 ай бұрын

    Good

  • @CottidaeSEA
    @CottidaeSEA9 ай бұрын

    I'd only use the URL parameters for filtering purposes personally. I do not believe that state belongs in the URL to a much greater extent than that. There are a few neat things you can do here and there, but keeping all state in the URL is not a good approach. Using an identifier is part of filtering, just as a side note, so ?id=abc123 would still valid in this regard. You could have the identifier as a part of the actual URL and not just a parameter, but that's nothing more than an implementation detail.

  • @dank56
    @dank569 ай бұрын

    Are you using a BrowserRouter? Surely there’s a lot more to it in prod as you can’t just refresh / paste in the url and get the router to take you back to the correct route? (404 scenario) Would you handle state on your server? Or use a HashRouter?

  • @golden_smiles
    @golden_smiles9 ай бұрын

    Brilliant idea, use it on tax forms, credit card payments and login screens.

  • @ajfalo-fi3721

    @ajfalo-fi3721

    9 ай бұрын

    Can't wait 😍😍

  • @spythere

    @spythere

    9 ай бұрын

    As it was mentioned, it's for FILTERING DATA, not for AUTH.

  • @golden_smiles

    @golden_smiles

    9 ай бұрын

    @@spythere So, I can't use it on ANY FORM, only on FILTERS THE DATA?! That sucks.

  • @exkoi
    @exkoi9 ай бұрын

    your thumbnail looks very similiar

  • @Deccoyi
    @Deccoyi8 ай бұрын

    does this rerender everything? or just related components?

  • @hongz1
    @hongz19 ай бұрын

    How to implement with NextJS app router? putting router.replace in onChange makes slow...

  • @quizzicalsebag
    @quizzicalsebag9 ай бұрын

    what’s the idea of this if you’re using a “state” like hook. it would be a client component on next too

  • @artemkaratai8958
    @artemkaratai89586 ай бұрын

    You haven't mentioned that "set state" function of useSearchParams behaves differently from "set state" function of useState hook when it's called multiple times during the same render cycle

  • @zunnoorainrafi5985
    @zunnoorainrafi59859 ай бұрын

    Hi Kyle! how we can add multiple search params in url like " products?category=shirts&color=red&size=lg "

  • @debanjandey64

    @debanjandey64

    9 ай бұрын

    You have to destructure the current search param object and then add attributes

  • @syedhaider0916
    @syedhaider09169 ай бұрын

    With due respect are you sure this can be used as a replacement for state management libraries like redux, jotai, flux etc?

  • @piyushaggarwal5207

    @piyushaggarwal5207

    9 ай бұрын

    No

  • @someonewhowantedtobeahero3206

    @someonewhowantedtobeahero3206

    9 ай бұрын

    This is only for data filtering purposes, you can't use this elsewhere without compromising security

  • @timd1613
    @timd16139 ай бұрын

    I would add local state and debounce url update for higher responsiveness

  • @DobesVandermeer

    @DobesVandermeer

    9 ай бұрын

    Have you noticed some kind of slowness with URL updates? They seem pretty fast to me.

  • @_jeff.medeiros
    @_jeff.medeiros9 ай бұрын

    lol i implemented this in my codebase like 3 days ago with zustand, just had to add this replace prop for the same result

  • @kazaakas
    @kazaakas9 ай бұрын

    I just wish browsers handled this better. I often see hundreds of entries in my history, because I typed a couple of words. Of course you can debounce the query update, but it's far from perfect that way.

  • @simboy
    @simboy8 ай бұрын

    Anyone know what the .get() method is. Isnt that from a map? Here it is with an object?

  • @ertyuiopos3942
    @ertyuiopos39429 ай бұрын

    Why state should belong to the url? I could simply create a FilterProvider and it will work fine. Why url though?

  • @NOPE-me7ob
    @NOPE-me7ob9 ай бұрын

    Brother kyle we need your help , please create video for react native and its complex navigations

  • @willmakk
    @willmakk9 ай бұрын

    We really are returning to monke.

  • @samarscript5824
    @samarscript58249 ай бұрын

    Can you please provide the git hub link for the same?

  • @waffle8364
    @waffle83649 ай бұрын

    next best thing to add is testing.. please show that more since it's like 80%of the job anyway

  • @eslama.hugair1666
    @eslama.hugair16669 ай бұрын

    What about the url limitations (how complex it can get)?!

  • @sadramohh
    @sadramohh9 ай бұрын

    Doesn't this introduce a potential XSS vulnerability? The string value in the `q` parameter is directly bound to the ``s value attribute.

  • @DobesVandermeer

    @DobesVandermeer

    9 ай бұрын

    Not really, the value is assigned using JavaScript property assignment so there's no string escaping issue. In SSR the string will be escaped properly. If you ever wrote the URL to the page without proper escaping you might have an issue but that's not dependent on this technique.

  • @karlstein9572

    @karlstein9572

    9 ай бұрын

    React handles (escape) this automatically when rendering, you can try it yourself.

  • @JohanDG7

    @JohanDG7

    9 ай бұрын

    There is no two way binding in react :)

  • @gokulvaradan4475
    @gokulvaradan44758 ай бұрын

    can any one say what is the nextjs router equivalent for {replace: true} in setSearchParams?

  • @MahmoudAbdullahAnani
    @MahmoudAbdullahAnani9 ай бұрын

    this is hook import from react or react-router-dom???

  • @ananthb2435

    @ananthb2435

    9 ай бұрын

    React-router-dom

  • @MahmoudAbdullahAnani

    @MahmoudAbdullahAnani

    9 ай бұрын

    @@ananthb2435 thx

  • @genovo
    @genovo9 ай бұрын

    Some APIs work like this, with a dependency on https

  • @carlosricardoziegler2650
    @carlosricardoziegler26509 ай бұрын

    Nice, need to be care about sensible data :)

  • @dev1876
    @dev18769 ай бұрын

    Do You sill use xstate?

  • @waleedsharif618
    @waleedsharif6189 ай бұрын

    Isnt this exactly how pages were made way back ?

  • @ismellpedo

    @ismellpedo

    9 ай бұрын

    They’re still built like this if you’re not a complete beginner working on pet projects

  • @MrBrandenS

    @MrBrandenS

    9 ай бұрын

    Yes, it's just another way to manage the state. Pick what works best for you.

  • @kmkowsik2958
    @kmkowsik29589 ай бұрын

    hello brother please do some tutorial for backend esspecially node js

  • @dianciehake
    @dianciehake9 ай бұрын

    Is there another way to persist states between pages?

  • @AshleyTennyson

    @AshleyTennyson

    9 ай бұрын

    redux , contextapi orrr prop drilling kinda

  • @matthewbeardsley7004
    @matthewbeardsley70047 ай бұрын

    any ideas how to do this in Svelte/SvelteKit?

  • @bizmich_
    @bizmich_2 ай бұрын

    how to clear q= when input is empty?

  • @muhammadyusufauliya9770
    @muhammadyusufauliya97709 ай бұрын

    are we going back to php now?

  • @ramkumar
    @ramkumar9 ай бұрын

    Why don't we create a useState wrapper custom hook that initialises state from local storage and make the setState method also update local storage

  • @derek_d

    @derek_d

    9 ай бұрын

    This is definitely a viable option assuming you don't care about sharing the URL as state.

  • @petrlaskevic1948

    @petrlaskevic1948

    9 ай бұрын

    Maybe a lot of unnecessary writes