Let's build a high performance app using Recoil and React | Recoil Tutorial Video

Поділитися
Вставка
  • Опубліковано 21 січ 2025

КОМЕНТАРІ • 52

  • @JacquesBlom
    @JacquesBlom  4 роки тому +7

    Hey everyone! 👋 Thanks so much to everyone for watching my videos. It means a lot. ❤️
    Because of the number of questions I've received about Recoil, I've decided to create a free, comprehensive Recoil course, where you can learn how to use Recoil like a pro.
    Check it out here: learnrecoil.com/
    See you there. 🙌

  • @ideologic3407
    @ideologic3407 3 роки тому

    This was the one I was searching for a long...thanks to youtube recommendations

  • @Nyasha_Nziboi
    @Nyasha_Nziboi 4 роки тому +2

    Amazing work, I really like the way you explain the concepts, your code is really well written and cheers for adding the resources

  • @MaxProgramming
    @MaxProgramming 3 роки тому +1

    Great! I'll give Recoil a try!
    Just a suggestion at 7:14, when logging something if you wrap it in curly braces, it'll log it with a label coz u log an object
    console.log({ something })

  • @JacquesBlom
    @JacquesBlom  4 роки тому +1

    Hey, folks. Thanks for watching. I hope it was helpful.
    I'm planning on doing more videos about Recoil real soon, so be sure to subscribe!
    There is a lot more to Recoil that I haven't yet unpacked, such as React Suspense integration, Async data fetching and data sync, DevTools, and a bunch of other interesting stuff.

    • @vssrikanthgarnepudi5952
      @vssrikanthgarnepudi5952 4 роки тому

      Great explanation , one of the best video on recoil. Make sure to do more videos on recoil.

  • @immortalx
    @immortalx 4 роки тому +2

    Nice video, it really makes the case for using recoil! Great Job!

  • @dmitrypatriarkh9757
    @dmitrypatriarkh9757 2 роки тому

    1:15 if we wrap the element component by memo() wouldn't this problem be fixed?

  • @kiranv6495
    @kiranv6495 3 роки тому +1

    But what if we need to get all the elements data in one place ? (eg: a global save button and on clicking that we need to send all the elements data to db)

  • @PratheekHegde
    @PratheekHegde 4 роки тому +1

    Neatly explained. Understood one of the use case for recoil.

  • @g-ytub
    @g-ytub 7 місяців тому

    I am late on this but it's really helpful for me to understand Recoil. thanks a lot to you

  • @JacquesBlom
    @JacquesBlom  4 роки тому

    Hi, all!
    Check out my latest video in the series, where I cover data fetching with Recoil and React Suspense:
    ua-cam.com/video/Hkd9gMYuYu4/v-deo.html 📡🌍

  • @LRXAORLOV
    @LRXAORLOV 4 роки тому

    Why do we save id in selectedElementIdState? Can we save the full item? We will not need an additional selector by id for element.

  • @harshitjoshi3082
    @harshitjoshi3082 3 роки тому

    Which theme is this ?

  • @intwominds1943
    @intwominds1943 4 роки тому

    Why is a context used for elements state instead of an atom like in your todo app example?

  • @tiagoagm
    @tiagoagm 4 роки тому

    Nice tutorial. Would love to know more about recoil.

    • @JacquesBlom
      @JacquesBlom  4 роки тому

      Thanks! I am planning to do a video soon about Atom Effects, which is a new experimental Recoil API, mainly used for syncing data with a server. Stay tuned.

    • @JacquesBlom
      @JacquesBlom  4 роки тому +1

      Hey Tiago. I'm going to be covering a bunch more in my free Recoil course I'm working on, which you can sign up for here: learnrecoil.com.

  • @bdk9830
    @bdk9830 3 роки тому

    this is biblical. thank you so much. now I can start my new project with recoil!

  • @albert21994
    @albert21994 3 роки тому

    you need way more subscribers

  • @carlosagsmendes
    @carlosagsmendes 4 роки тому

    Hi, thanks for the video! I want to have a different border for the selected element. Is there a performant way to know if an element is selected?

    • @JacquesBlom
      @JacquesBlom  4 роки тому

      Hey Carlos. Check out this atom in the latest iteration of my code: github.com/jacques-blom/recoil-design-tool/blob/c44ae0352b3178ca45210aaad61cbded5afb1f24/src/Element/elementState.tsx#L60
      It's an array of IDs, so that multiple items can be selected and dragged at the same time. Here is a Tweet showing the added multi-select capability: twitter.com/jacques_codes/status/1302238344517214212
      Hope this helps!

  • @AykutKlc
    @AykutKlc 3 роки тому

    Is there a best practlce for defining the key for an atom or atom family? why don't we use a GUID or some other sort of non-clashing strings?
    What if we're developing a component library and my atom key clashes with one of the application atoms?

    • @JacquesBlom
      @JacquesBlom  3 роки тому +1

      The reason you have to explicitly provide a key is because Recoil data should be serialisable. And if you don't explicitly provide a key then Recoil won't know which atoms and atom families to rehydrate state back to.
      This is an intentional design decision by the Recoil team. The downside is that you have to provide keys, but the upside is serialization.
      For something like a component library, I'd add a prefix to all your keys. (e.g. "myLibraryName-atomName")
      Hope that helps!

  • @MikkMartin
    @MikkMartin 3 роки тому

    Hey, nice quick explanation. Is there a simple way to get all the items for an atomFamily? I want to calculate the intersections of a drag-selection box.

    • @JacquesBlom
      @JacquesBlom  3 роки тому +1

      Hey Mikk. Yeah you can do it by building a selector that...
      1. First fetches a list of all IDs for the items you want to fetch.
      2. Then fetches all the atom family values by iterating over the ids.
      Here's a quick example I've put together: codesandbox.io/s/selection-bounding-box-eiyic
      Hope this helps!

    • @MikkMartin
      @MikkMartin 3 роки тому

      @@JacquesBlom Got it working! A bit of a different implementation (drag box to select nodes). But thanks regardless, it helped!
      node-editor-kv7e0rr6x-mikkmartin.vercel.app/

    • @JacquesBlom
      @JacquesBlom  3 роки тому

      @@MikkMartin Awesome :)

  • @DiegoArcega1
    @DiegoArcega1 3 роки тому

    Can you make a comparison to zustand? Nice content..subscribed

  • @UIGems
    @UIGems 4 роки тому +2

    Subscribed! Good content.. Recoil✌

    • @JacquesBlom
      @JacquesBlom  4 роки тому +1

      Thanks! If you're interested in some more Recoil content, I'm working on a free Recoil course, which you can sign up for here: learnrecoil.com.

  • @deamorta6117
    @deamorta6117 4 роки тому +1

    Now what's left are middlewares and tools just like in redux and everything will be good. i'll be using this though starting today thanks!

    • @JacquesBlom
      @JacquesBlom  4 роки тому

      I'll be covering this in my upcoming free Recoil course, which you can sign up for here: learnrecoil.com. 🙂

  • @ehsankhorasani_
    @ehsankhorasani_ 4 роки тому

    Thanks man. can you explain some gotchas and tradeoff using Recoil.js and would you recommend to switch my production app to Recoil.js

    • @JacquesBlom
      @JacquesBlom  4 роки тому

      I'll be covering this in my upcoming free Recoil course, which you can sign up for here: learnrecoil.com. 🙂

  •  4 роки тому

    I've been using recoil for my last project, it's great and I can move data between components much faster and with les debugging. I only have two problems, first, React Dev Tools are not working very well, Performance recording is not working when using recoil and show updated components is not working either. And to debugging the current recoil state with Redux Dev Tools is not compatible, so I'm using Recoilize, it's great when it works, but only when it works.

    • @JacquesBlom
      @JacquesBlom  4 роки тому +1

      Yeah Recoil is still a very young library, so it's going to take some time for the ecosystem around it to evolve.

  • @sonnybrown4758
    @sonnybrown4758 3 роки тому +4

    Really nice demo. I can see how hard you worked and how good of a developer you are. The one thing I'm not a fan of is how you edited this. It's very choppy and you're in one place in the code and then another and it's hard to follow along a lot of the time. I'd recommend if you are going to cut time that you don't do it when moving around in the code. But I'm in awe of your skills otherwise.

  • @ytchess
    @ytchess 4 роки тому +1

    Please mention every time if your video is going to be about react+typescript, so I can skip it! I'm looking for react+(es6+) videos!

    • @JacquesBlom
      @JacquesBlom  4 роки тому

      Hey Kai. I'll likely always use TypeScript in my examples. The syntax is the same as ES6/ESNEXT, but with some type annotations. For demo code, I skip the complex bits of TS where I can, to try to make it easy for non-TS coders to understand, too.

    • @ytchess
      @ytchess 4 роки тому +1

      @@JacquesBlom I'm telling this because I'm not subscribed to your channel (I don't know who you are), I just follow the suggestions from youtube! Mentioning that a video is about typescript code will help youtube algorithms do not include that kind of suggestion for me (I'm always deleting videos from the youtube history if I'm not interested in getting suggestions about similar videos)! Thanks in advance!

  • @eminqasimovdev
    @eminqasimovdev 3 роки тому

    Woow. Did I see right thing? 10:47
    I knew about atomic concept of recoil. But not tried yet.
    How this possible, ui of Properties in right sidebar changes. But react does not render them. Is react devtool doing something differently. I didn't see green/yellow borders.
    Pls. I also some questions.
    What's is actual size of recoil? Bundlefobia shows 60+kb. Maybe it is wrong.
    Is it safe to use Recoil production?
    Is it in beta yet?
    Sorry. I forgot to thank you. Keep doing amazing tutorials. You are good at it.

  • @marcodalborgo
    @marcodalborgo 4 роки тому

    You are the best!

    • @JacquesBlom
      @JacquesBlom  4 роки тому

      Thanks, Marco! If you want to learn more, I'm working on a free Recoil course, which you can sign up for here: learnrecoil.com.

  • @omicronx94
    @omicronx94 4 роки тому

    Or just use Redux

    • @JacquesBlom
      @JacquesBlom  4 роки тому +3

      For sure! Millions of apps out there still use Redux. It's a great state management solution with a big, mature ecosystem around it.
      It does have a few drawbacks though, that are making some people move away from it:
      1. The first is, of course, the large amount of boilerplate involved.
      2. The second, less obvious issue is that, whenever you dispatch an action, all reducers and selectors have to re-run. This doesn't mean all your components have to re-render, but the amount of computation per action increases with the number of reducers and components. So in some situations, that could cause scalability issues.
      Redux is still here to stay for now. But I think it's worth looking at other models for React state management.

    • @os365
      @os365 3 роки тому

      @@JacquesBlom That's right, I have a big application with that problem for the many about all redux files (reducers, selector, action, ...), and it is a repeating all