Exercises: Custom Hooks - React In Depth

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

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

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

    Hats off to your consistency!!

  • @ruskasielu6261
    @ruskasielu6261 9 หลายเดือนก่อน

    I would like if you could show us the result you expect at the beginning of each exercice (not the code, just the app). Sometimes I'm not sure of what we are supposed to do until I see the solution, and I realise I could have done it alone if I had known.
    Besides that, absolutely stellar content, the best react course I've seen online !

    • @TechWithNader
      @TechWithNader  9 หลายเดือนก่อน

      Thanks for the recommendation! I'll try to find a way to incorporate this in future videos 😃

    • @ruskasielu6261
      @ruskasielu6261 9 หลายเดือนก่อน

      @@TechWithNader great to hear ! Also are you planning to do other JS-related courses like Express or typescript at some point?

    • @TechWithNader
      @TechWithNader  9 หลายเดือนก่อน +1

      @@ruskasielu6261 I have the REST API course in progress right now using Deno (TS/JS) 🦕

    • @ruskasielu6261
      @ruskasielu6261 9 หลายเดือนก่อน

      @@TechWithNader i did see it, but I was a bit confused when it comes to the choice of deno instead of Node (as it's a lot more popular). Will any of these skills transfer to regular Nodejs?

    • @TechWithNader
      @TechWithNader  9 หลายเดือนก่อน +1

      @@ruskasielu6261 Yup! I chose Deno because it uses all the standard Web APIs and they transfer to anything that uses them 😊 Also the main concepts apply to any style of rest like API 🥳

  • @aliajellu
    @aliajellu 3 หลายเดือนก่อน

    Thanks a lot @TechWithNader!
    Regarding Ex 2, I found a simpler solution which seems to work. Are there any problems with this approach?
    const [state, setState] = useState(initialState)
    function setStateWithLogging(newState) {
    let resultingState
    resultingState = typeof newState === "function" ? newState(state) : newState
    setState(resultingState)
    console.log("state has changed from " + state + " to " + resultingState)
    }
    return [state, setStateWithLogging]

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

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

    nice job 👊🏿

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

    Hello @TechWithNader , many thanks for the extremely helpful video.
    I got a question for you regarding Exercise 3 (useQuery custom hook): isn't it a React anti-pattern to fetch outside of a useEffect hook? I'm referring to the function fetcher you coded. Technically, the network request as you coded the hook is not placed inside a useEffect hook. Should this be a point of concern ?
    Thanks again.

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

      Great question! You are correct that you should generally not fetch data outside a use effect (since it’s a side effect). In this case we still abide by that rule since inside the hook the fetch code is contained inside the use effect. It just looks like we are using it outside in the component we are using the hook in, but picture copying and pasting the hook code and you’ll see it’s still all contained in the effect and state calls as you’d expect 😊
      Hope that makes sense!

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

    Fire 🔥

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

    'Promosm' 🎉