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
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
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!
i notice that all of tutorial example are neat and clean.i love your teaching style.go ahead and create more videos.thanks sam
Insanely good video. You covered the hook really well which I initially did not understood upon reading the announcement.
Thats the greatest explaination of useSyncSexernalStore ive ever heard so far
Killer stuff, Sam! Love these deep-dives into Suspense and concurrence, feels like I'm learning alongside. Keep 'em coming!
Well thought out explainaing. Thanks Sam!
Great vid!! Greetings from Peru ❤
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
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.
Great contents. I cannot stop myself to watch other videos :) Great job man. Keep it up!
I rarely comment on videos but I gotta say - I'm loving your videos around concurrent react/suspense! 🙌
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
i love you, you are the best really , keep publishing more amazing content
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!
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!
beautiful video!
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
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.. 😀
man i like your videos thanks so much
Cool video. As always
Thanks a lot !
well done!
Very nice
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
Жыл бұрын
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.
WOW, It's something similar to Recoil which is awesome too.
@samselikoff
2 жыл бұрын
Yessir - look, there it is! github.com/facebookexperimental/Recoil/blob/708fcfe93a32beab35b6a9345a05dd35ab736a08/packages/recoil/hooks/Recoil_Hooks.js#L351
❤️
👏
Really nice stuff... Isnt this a pubsub data pattern.. I found the api a little complicated tbh...
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
Awesome video! Sam, please share your mic setup and the arm 🙂
@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
2 жыл бұрын
@@samselikoff Sam, huge thanks to you for providing the detailed info. Love your content and the podcast!
why do you use let instead of const in useState hooks?
Its like this channel is the gateway from being a soydev to a chad