How to safely use external state in Concurrent React

Ойын-сауық

Learn how external state libraries use the new useSyncExternalState hook to interact with the upcoming Concurrent features of React 18.
React Discussion on useSyncExternalStore: github.com/reactwg/react-18/d...
GitHub: github.com/samselikoff/2022-0...

Пікірлер: 37

  • @dev__adi
    @dev__adi2 жыл бұрын

    I'm impressed with how you transitioned step by step with no convoluted leap of logic or asking us to imagine a complicated scenario.

  • @samselikoff

    @samselikoff

    2 жыл бұрын

    Appreciate the comment! I *have* to do this when learning something new or else it doesn't stick. If any part of any step doesn't make sense, I stop and ask questions until it does. Glad it translated in the video!

  • @frontendonly
    @frontendonly Жыл бұрын

    i notice that all of tutorial example are neat and clean.i love your teaching style.go ahead and create more videos.thanks sam

  • @NeerajLagwankar
    @NeerajLagwankar2 жыл бұрын

    Insanely good video. You covered the hook really well which I initially did not understood upon reading the announcement.

  • @thalibmuhammad9519
    @thalibmuhammad95192 жыл бұрын

    Thats the greatest explaination of useSyncSexernalStore ive ever heard so far

  • @mryechkin
    @mryechkin2 жыл бұрын

    Killer stuff, Sam! Love these deep-dives into Suspense and concurrence, feels like I'm learning alongside. Keep 'em coming!

  • @j0hannes5
    @j0hannes52 жыл бұрын

    Well thought out explainaing. Thanks Sam!

  • @Programandoenc
    @Programandoenc2 жыл бұрын

    Great vid!! Greetings from Peru ❤

  • @technikhil314
    @technikhil3142 жыл бұрын

    This seems like good api for keeping url state in url and directly use in component rather than deriving app state from url. this can be used to sync url state changes via pushstate between multiple components like sort,filter and searchbox.

  • @samselikoff

    @samselikoff

    2 жыл бұрын

    Ooh, not a bad idea! I guess you'd need to add some listeners for onpopstate/onpushstate to update your store and then call notify(). Should be able to do it though.

  • @hamitaksln
    @hamitaksln Жыл бұрын

    Great contents. I cannot stop myself to watch other videos :) Great job man. Keep it up!

  • @klapec_
    @klapec_2 жыл бұрын

    I rarely comment on videos but I gotta say - I'm loving your videos around concurrent react/suspense! 🙌

  • @hanibal43
    @hanibal432 жыл бұрын

    Man I just found your channel and its a breath of fresh air. I feel the youtube space is so polluted with these basic projects trying to teach react that stuff like this which has actual value is lost

  • @ahmed-ll3kk
    @ahmed-ll3kk3 ай бұрын

    i love you, you are the best really , keep publishing more amazing content

  • @real-oppenheimer
    @real-oppenheimer2 жыл бұрын

    As an advanced React developer, the topics you pick for your videos and the way you describe examples for them is very intriguing. Great job!

  • @jimshtepa5423
    @jimshtepa54232 жыл бұрын

    watched the video, understood 80% of the content. not because you explained it poorly but because I am not that advanced in using react and am not very comfortable with concepts such as concurrency, event loop of the js engine and returning the control from one entity to another (from react to the browser). Thank you for publishing this kind of materials it helps a lot to motivate to move ahead and learn advanced stuff. I also followed through the links you have attached and the conversation among react core team and other library ownwers (redux, zustand, apollo-client etc) is on another level, I can hardly understand what they are referring to. But glad that at least I got this chance to see what an advanced level means. Thank you, Sam!

  • @catte_6376
    @catte_63766 ай бұрын

    beautiful video!

  • @andrewlevy2182
    @andrewlevy21822 жыл бұрын

    These are such high quality videos. You're going to be one of the biggest react youtubers in 2022 at this rate. Looking forward to more! Do you dabble in react native at all?

  • @samselikoff

    @samselikoff

    2 жыл бұрын

    Thank you! I haven't used React Native yet but since I use most of my side projects on my iPhone I probably should check it out.. 😀

  • @mod7ex_fx
    @mod7ex_fx Жыл бұрын

    man i like your videos thanks so much

  • @tech3425
    @tech3425 Жыл бұрын

    Cool video. As always

  • @geraldodev
    @geraldodev2 жыл бұрын

    Thanks a lot !

  • @VishalSINGH-mx2zr
    @VishalSINGH-mx2zr10 ай бұрын

    well done!

  • @mohammadalikarami9961
    @mohammadalikarami99617 ай бұрын

    Very nice

  • @attiliop.8639
    @attiliop.8639 Жыл бұрын

    I am new to React 18 hooks. This video is genius (thanks for sharing). Question: Are we always telling useSyncExternalState when data has changed no matter the use case? Seems like we do. Thanks

  • @samselikoff

    @samselikoff

    Жыл бұрын

    Yep that's the idea! If that data needs to end up in React you notify it whenever it changes. That way any subscriber that needs it knows when it should re-render.

  • @MinhNguyenTao
    @MinhNguyenTao2 жыл бұрын

    WOW, It's something similar to Recoil which is awesome too.

  • @samselikoff

    @samselikoff

    2 жыл бұрын

    Yessir - look, there it is! github.com/facebookexperimental/Recoil/blob/708fcfe93a32beab35b6a9345a05dd35ab736a08/packages/recoil/hooks/Recoil_Hooks.js#L351

  • @vaddecsjeevankumar6543
    @vaddecsjeevankumar6543 Жыл бұрын

    ❤️

  • @willianf
    @willianf2 жыл бұрын

    👏

  • @nitishphanse5310
    @nitishphanse53102 жыл бұрын

    Really nice stuff... Isnt this a pubsub data pattern.. I found the api a little complicated tbh...

  • @alexavery8182
    @alexavery818210 ай бұрын

    10:10 Since React is notified of changes to the store, would this even be possible? As I understand it, React would know store updated and the component subscribed to the store would re-render as a result, so there wouldn't be a possibility of discord between 2 references the store. At least that's my understanding of how it works and only reason I ask this is I want to make sure I'm understanding correctly

  • @heyiamigor
    @heyiamigor2 жыл бұрын

    Awesome video! Sam, please share your mic setup and the arm 🙂

  • @samselikoff

    @samselikoff

    2 жыл бұрын

    The mic is the Rode Procaster www.rode.com/microphones/procaster Which plugs into the Audient iD4 audient.com/products/audio-interfaces/id4/overview/ Which plugs into my computer via USB. And the arm is the Blue compass www.bluemic.com/en-us/products/compass/

  • @heyiamigor

    @heyiamigor

    2 жыл бұрын

    @@samselikoff Sam, huge thanks to you for providing the detailed info. Love your content and the podcast!

  • @anhdunghisinh
    @anhdunghisinh2 жыл бұрын

    why do you use let instead of const in useState hooks?

  • @tech3425
    @tech3425 Жыл бұрын

    Its like this channel is the gateway from being a soydev to a chad

Келесі