ReactJS Course [12] - Custom Hooks Tutorial

Поділитися
Вставка
  • Опубліковано 12 вер 2024

КОМЕНТАРІ • 54

  • @murshidameen5009
    @murshidameen5009 11 місяців тому +7

    tbh this is the best react tutorial playlist in yt rn ,ill recommend to evryone

  • @shivamsharma6106
    @shivamsharma6106 2 роки тому +11

    Hey Pedro i love the way you are teaching things, as a beginner getting to cool stuff in a way which is very clear and easy to grab. Keep up the good work.

  • @ishimweisaac1019
    @ishimweisaac1019 2 роки тому +7

    Good to see you back Pedro. I've been checking my notifications everyday.

  • @DriveandThrive
    @DriveandThrive Рік тому +5

    You are making learning react a pleasant experience. Appreciate your content

  • @olenayevtushok2014
    @olenayevtushok2014 Рік тому +1

    I watched so many videos about custom hooks and only this video helped me understand them a little bit. I succeed with the exercise! Thank you Pedro!

  • @richardleungwoogabriel9317
    @richardleungwoogabriel9317 2 роки тому +2

    Thank you alot Pedro!! keep it up!! love what you are doing! leanring so much!

  • @stn369
    @stn369 2 роки тому +1

    Thanks bro, you came back and posted videos!

  • @martinirungu2381
    @martinirungu2381 2 роки тому +1

    Glad to have you back sir

  • @uafkhurram
    @uafkhurram 8 місяців тому

    really i like the way you teach. i have learnt many from you. thank you buddy

  • @ThColinPereira
    @ThColinPereira 2 роки тому +1

    He's back! Great video Pedro

  • @dzulfiqarzaky5557
    @dzulfiqarzaky5557 2 роки тому +1

    Hi Pedro, i watched a lot of your tutorial and it really helped me a lot! Thank you for all the content you give us all!!
    By the way i watched your tutorial about useContext hooks before this, and its seem so similar to me.
    Did the custom hooks can be used similar to useContext as a global state?

  • @abdssamad5246
    @abdssamad5246 2 роки тому +1

    Best notification of the day❤❤

  • @poojakamble3643
    @poojakamble3643 Рік тому +1

    excercise:
    import { useState } from "react";
    export const useCounter = () => {
    const [state,setState] =useState(0);
    const incrementCounter=()=>{
    setState(state + 1)
    }
    const decrementCounter=()=>{
    setState(state-1)
    }
    const resetCounter=()=>{
    setState(0)
    }
    return [state,incrementCounter,decrementCounter,resetCounter]
    }
    import React from 'react'
    import { useCounter } from './useCounter'
    const Counter = () => {
    //values coming from custom hook- useCounter hook
    const [state,incrementCounter,decrementCounter,resetCounter] = useCounter()
    return (

    {state}
    Increment
    Decrement
    Reset

    )
    }
    export default Counter
    please let me know in case of any implementation mistake done

  • @beedo987
    @beedo987 10 місяців тому

    This is awesome my brother ❤

  • @vinaypatil8009
    @vinaypatil8009 2 роки тому +1

    Nice tutorial thanks

  • @sanuyadav-ys3fb
    @sanuyadav-ys3fb Рік тому

    Fantastic brother! Thanks a lot!

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

    Thank you brother, video was awesome

  • @k303k
    @k303k Рік тому

    Thank you so much for very clear explanation Pedro!

  • @andrewandrosow4797
    @andrewandrosow4797 2 місяці тому

    In my opinion - there is redundency. Why we can`t use only "Axios" library for these examples? Maybe the author is specialist, but the course for beginners.

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

    Awesome Pedro!!!

  • @azaz9344
    @azaz9344 Рік тому

    wooooow this is amazing I am just in 10:06 but I can't finish the video before writing a comment thanks a lot😀

  • @abdessamade6995
    @abdessamade6995 2 роки тому +1

    great video♥♥♥

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

    Fantastic video very clear thank you

  • @WillSmith-qt7me
    @WillSmith-qt7me 2 роки тому

    Very good React course, the highest class.

  • @Kal-El-gm5pc
    @Kal-El-gm5pc 9 місяців тому

    I have a question. When exporting as an array and you import where you need it, does the order you follow to import matter, cause for example, if we write the const for your 2nd example as an array, will i need to also follow the order it was exported as ? Cause i wonder how react will know if i alter the names

  • @user-ke9jo8dk2s
    @user-ke9jo8dk2s 2 роки тому

    Thank You Pedro a lot!!!!

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

    Awesome tutorial very useful thank you

  • @easterntornado
    @easterntornado 10 місяців тому

    Best custom hooks explained

  • @rodellibed9100
    @rodellibed9100 2 роки тому +1

    Next tutorial bro node Js after your all react js tutorial is done . Thank you and Godbless

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

    Hi Pedro... Could you make a video on best libraries to format inputs for ReactJS. Thing like Date/Time Pickers, Money and etc. Thanks

  • @escaladus4860
    @escaladus4860 8 місяців тому

    can we use just setState(!state) ?

  • @eromoseleogbeide4075
    @eromoseleogbeide4075 Рік тому

    hey pedro i wanted to ask inthe example you used the useQuery hook without the queryClient and queryClient provider but when i tried using it i had problems i dont know if you can clearify on that

  • @Andres_Agudelo0101
    @Andres_Agudelo0101 2 роки тому +1

    the best pedrito tech

  • @MasteryOfGameDev
    @MasteryOfGameDev Рік тому +1

    a little question for the exercise: Can you explain me why you used inside the increase setCount((prev)=>(prev+1)) and not setCount(count+1) ? ty a lot

    • @olenayevtushok2014
      @olenayevtushok2014 Рік тому

      Hello! As I understand it: if you need a previous value to set a new value, you have to use arrow function. If you don't need the previous value to set a new value, you can just enter the new value. In this case you need to know the previous value of counter, that's why use arrow function.

    • @whatisthis__95
      @whatisthis__95 Рік тому

      I have the same question. I did the excercise as you wrote it and it works perfectly. It would be nice to get an answer back

    • @whatisthis__95
      @whatisthis__95 Рік тому

      @PedroTechnologies could you give a feedback on that? Thanks

  • @currojugando6585
    @currojugando6585 Рік тому

    Hello Pedro. the link for the exercises files is wrong, btw i love your videos!

    • @currojugando6585
      @currojugando6585 Рік тому

      I mean you have to click 2 times to go and the project uploaded is not from this video

  • @hardcode6372
    @hardcode6372 Рік тому

    awesome tutorial will you please make a video on react query+mui where-> data [{from API ->fetch using reactquery}] is display on the basis of => fromDate(date picker (mui)) and ToDate(date picker) and then submit(button) => with validation and show that data in a table i tried to search the internet it is not available please help.thn u.

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

    Restart setCount(initialVal)

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

    Does useQuery depricated at version 4.2.3? Example dont work! Dude where is code for useGetCat example...

  • @araarsalan1307
    @araarsalan1307 Рік тому +1

    i just dont get custom hooks idk why. am i gonna fail as a developer if i completly ignore it lol?

    • @PedroTechnologies
      @PedroTechnologies  Рік тому

      It is ok to be confused about topics in the beginning hahaha you can ignore it for now, just like i ignored some topics that got me confused when i was learning it. I mean, you will eventually understand it and use it, but if ignoring it makes you continue progressing, don't be scared of doing so!

    • @araarsalan1307
      @araarsalan1307 Рік тому

      @@PedroTechnologies thank you thats so reassuring

  • @bq_wang
    @bq_wang Рік тому

    👍👍👍👍👍

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

    so basically custom hook is a regular function but its name started with a capital letter or "use"

    • @fortnitesmash7166
      @fortnitesmash7166 2 роки тому +1

      But it's a lot difficult to use normal function from other module.
      It's harder and complicated to because of its value that can't be accessible

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

    poggers

  • @vityachess
    @vityachess 10 місяців тому

    I think this is too advanced topic for beginner...