React Signals tutorial - practical guide

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 พ.ย. 2024

ความคิดเห็น • 31

  • @CodeWithAhsan
    @CodeWithAhsan  2 ปีที่แล้ว

    Do you think this is better than Redux? Or will you keep using Redux? Or is there a different State Management library that you prefer?

    • @greekapostle4548
      @greekapostle4548 2 ปีที่แล้ว +1

      I prefer angular forever 😍

    • @CodeWithAhsan
      @CodeWithAhsan  2 ปีที่แล้ว +1

      @@greekapostle4548 hahah!! For sure!!! Angular FTW

    • @naseeriyat9241
      @naseeriyat9241 2 ปีที่แล้ว +1

      It will be a bit difficult to shift from reduced 😊

    • @CodeWithAhsan
      @CodeWithAhsan  2 ปีที่แล้ว +1

      Changes are always difficult. True

    • @JakubSK
      @JakubSK ปีที่แล้ว +1

      No need for redux with the native components built into React for a while now.

  • @codemonkeynorth7503
    @codemonkeynorth7503 6 หลายเดือนก่อน +1

    Better to just use {count} instead of {count.value} in your jsx part, because it doesn’t cause the whole component to rerender on change, it just updates that placeholder

  • @garcipat
    @garcipat 2 หลายเดือนก่อน

    Is this with the AuthSignals the recommended way to store the values?

  • @riddy6421
    @riddy6421 11 หลายเดือนก่อน +1

    Nice Video. I'm trying to use signals, but it seems they don't work with `react-navigation` ?

    • @CodeWithAhsan
      @CodeWithAhsan  11 หลายเดือนก่อน

      What error did you face with signals and React navigation ?

  • @SahraClayton
    @SahraClayton 2 ปีที่แล้ว +1

    Do Preact signals work with React version 18, I can't remember who's video I watched but I thought they said that signals do not work with React concurrent mode. I might of heard that wrong.
    They do look very good though, seems to solve some of React's problems.

    • @CodeWithAhsan
      @CodeWithAhsan  2 ปีที่แล้ว

      Yeah, they definitely solve the prop drilling and state management issues. Even out of the components’ scope.
      I tested it with the latest version of React in this video. I haven’t specifically tested with a deep dive in concurrent mode yet

    • @SahraClayton
      @SahraClayton 2 ปีที่แล้ว

      @@CodeWithAhsan Thanks for replying, sorry but could you tell me a brief overview of what React concurrent mode is. I am new to web development and the coding bootcamp I am on hasn't covered what concurrent mode is.

  • @question_ij
    @question_ij 10 หลายเดือนก่อน +1

    Hi...i love ur video could you tell me how u edited, mostly putting ur social handle in d video. Thanks

  • @AbdulBasit-to2xr
    @AbdulBasit-to2xr 11 หลายเดือนก่อน

    It updates the value like "count.value++". Does it mean it does update the value in a mutable way?
    what if we have a complex data like
    var foo = signal({ a: 1, b: 2, d : { e: 5 } })
    should I have to update the original object like foo.value.d.e = 10 // update the e value ??

    • @olesodynets979
      @olesodynets979 10 หลายเดือนก่อน

      Signals can be nested.
      So in this example it would be: signal({ a: signal(1), b: signal(2), d: { e: signal(5) } })
      Or, if you're planning on updating "d": signal({ a: signal(1), b: signal(2), d: signal({ e: signal(5) )} }) // Wrapped "{e:signal(5)}" into another signal
      ----
      I recon, this approach will lead to a lot of pain when trying to manage complex states.

  • @pranjuljain6025
    @pranjuljain6025 8 หลายเดือนก่อน +2

    First time in my life where library(@preact/signals-react
    ) is not working

  • @EthanStandel
    @EthanStandel 2 ปีที่แล้ว +3

    Shameless plug, but if you want Signals to scale like a full state management solution, you grab preact-signal-store. Currently it only supports Preact, but I'm working on converting it to a monorepo that exports a package that works with React as well.

  • @tonyohagan1195
    @tonyohagan1195 ปีที่แล้ว +1

    Wow! React has caught to Vue.

    • @CodeWithAhsan
      @CodeWithAhsan  ปีที่แล้ว

      Looks like it.
      And we have Angular introducing signals soon too. Exciting times!

  • @brencancer
    @brencancer 2 ปีที่แล้ว +1

    great content

  • @yabuking84
    @yabuking84 8 หลายเดือนก่อน

    Maybe add which signals package to install. Not sure why you skipped that.

  • @mognomoinak1309
    @mognomoinak1309 2 หลายเดือนก่อน

    Hi Ahsan, can you please share the source code on github or something similar. I would be very greatful.

  • @question_ij
    @question_ij 10 หลายเดือนก่อน +1

    Hi...i love ur video could you tell me how u edited, mostly putting ur social handle in d video. Thanks

    • @CodeWithAhsan
      @CodeWithAhsan  10 หลายเดือนก่อน

      Hey there.
      I use davinci resolve for editing my videos :) I had the overlay (with green screen) created from a video editor. I just use that in all videos now.

    • @question_ij
      @question_ij 10 หลายเดือนก่อน

      Okay thank you

    • @question_ij
      @question_ij 10 หลายเดือนก่อน

      Have a second question. I tried coding along but I got stuck it not working or updating I use react18 I don't know why.
      Thank you