First Look at React useDeferredValue Hook

Поделиться
HTML-код
  • Опубликовано: 12 сен 2024

Комментарии • 36

  • @wcandillon
    @wcandillon 4 года назад +6

    Your videos are incredible! Congrats & keep it going!

  • @dealloc
    @dealloc 4 года назад

    useDefferedValue is really useful if you want SWR (stale-while-revalidate) as you showed in your first example. It gives you more control over individual parts, rather than as a whole. The reason that it shows the old values and reveal newer values as time goes on, is due to how concurrent mode works in React with regards to how it prioritizes user input, fetching/timeouts and rendering.

  • @MrPlaiedes
    @MrPlaiedes 4 года назад +2

    This feels like suspense for suspense...

  • @diveintohacking
    @diveintohacking 4 года назад +2

    Hi, Ben. I'm Ham from Japan. I've been a big fan of your programming channel. Thank you for providing informative tutorial videos! I've learnt a lot from them!
    I'm very curious about how to record the screen and your face at the same time without SOUND(voice) DELAY.
    Could I have the application name which you use?

    • @bawad
      @bawad  4 года назад +1

      obsproject.com/

    • @diveintohacking
      @diveintohacking 4 года назад

      @@bawad Wow, I can't believe it! Thank you so much, Ben! I'll give it a go!

  • @Hugo280603
    @Hugo280603 4 года назад

    Really easy to understand! Thanks. You know what would be great if you could explain Lazy loading using suspense

    • @bawad
      @bawad  4 года назад

      I might do this

  • @artgurianov
    @artgurianov 4 года назад

    Hi Ben! I saw once you used TypeDI in one of your projects, can you please make a video of explaining it's cases and workflow?

    • @bawad
      @bawad  4 года назад

      It's for dependency injection
      ruclips.net/video/5YYsfkl2UCM/видео.html

  • @denimyftiu188
    @denimyftiu188 2 года назад

    love

  • @vishnuprabuselvaraj9795
    @vishnuprabuselvaraj9795 4 года назад

    Good work. My react application take long time for initial loading (18 sec) . How do reduce.
    Lazy loading is possible for reduce my initial loading time

  • @DDoesT
    @DDoesT 4 года назад

    Hmm got the clone and getting Object(...) is not a function

  • @aashayamballi
    @aashayamballi 4 года назад

    Thanks Ben 😊😊

  • @TheMrsavio123
    @TheMrsavio123 4 года назад

    Amazing!

  • @aqueleprogramador
    @aqueleprogramador 3 года назад

    is it like a denounce?

  • @lewisjablackburn
    @lewisjablackburn 4 года назад

    more react tutorials. thank you

  • @devk6810
    @devk6810 4 года назад +2

    can you just point out real-world examples, where we can use these hooks in real-world beside hardcoded timeout

    • @bawad
      @bawad  4 года назад +2

      yeah I'm still getting a feel for them, then I'll be doing that

    • @devk6810
      @devk6810 4 года назад

      Yeah we will be waiting

  • @chubbyshady
    @chubbyshady 4 года назад +1

    Why is this a hook? Couldn't this be created as a function or something? Doesn't seem like such a big deal of a feature

    • @bawad
      @bawad  4 года назад

      I think it needs to be a hook because it triggers a rerender

  •  4 года назад

    This hooks are tree shaked right?

    • @bawad
      @bawad  4 года назад

      I'm not sure, but I assume so

  • @alldayalone24
    @alldayalone24 4 года назад

    What do you use for ctrl+click in vscode?

    • @bawad
      @bawad  4 года назад

      it should work by default, you can also right click the variable and it's go to definition

    • @alldayalone24
      @alldayalone24 4 года назад

      @@bawad, I think it's not working for absolute paths but I'm not sure

    •  4 года назад

      @@alldayalone24 for absolute paths, try adding a configuration to jsconfig.json

  • @krtirtho
    @krtirtho 3 года назад

    Sorry Ben, this hook is no longer in the major release

  • @les2997
    @les2997 4 года назад

    I wish there was an option not to cycle and work like useDebounce.
    const [text, setText] = useState('Hello');
    const [value] = useDebounce(text, 1000);
    github.com/xnimorz/use-debounce

    • @bawad
      @bawad  4 года назад

      someone messaged me after the fact and turns out the cycling is a bug and it should work like debouncing

    • @les2997
      @les2997 4 года назад

      @@bawad Yep, I found it.
      github.com/facebook/react/issues/17185
      I'd use useDebounce, which has more options.
      github.com/xnimorz/use-debounce

  • @sherazraees6746
    @sherazraees6746 4 года назад

    Ben can i contact to u instagram

    • @bawad
      @bawad  4 года назад

      sure