React Higher Order Components Tutorial | ReactJS HOC Pattern | React HOC in 30 Minutes for Beginners

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

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

  • @DipeshMalvia
    @DipeshMalvia  3 года назад +16

    Guys, if the video is helpful or you learned something than please appreciate and hit the LIKE and SUBSCRIBE button and help this channel to GROW😉

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

      Hey Dipesh, can you post video link for search functionality?

    • @HardeepSingh-hv4gn
      @HardeepSingh-hv4gn 7 месяцев назад

      why are you using fucking class component for HOC what the fuck r u doing u also don't know

  • @jeisongarzon6066
    @jeisongarzon6066 2 года назад +8

    plss make this same video but with functional Components instead of Class. Ty !!!

    • @gamerzboy99
      @gamerzboy99 Год назад

      Hoc can only use with functional component class component bekaar hai

  • @jose6183
    @jose6183 3 года назад +22

    That was actually a pretty clear and simple explanation. I understood you perfectly. So I just have a comment: isn't it better to use nowadays the newer React Hooks instead of using classes to create this kind of components? Instead of componentDidMount and all that it could be easier to implement via the useEffect() hook and as a regular functional component. Thanks anyway, great explanation!

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

      it's exactly what I'm thinking about. Is the mix of approaches good?

    • @NotInRightMind
      @NotInRightMind Год назад

      @@baikovamaria5725 it's same. idk the reason this person using class hoc instead func hoc. But it basically the same

    • @Drayken
      @Drayken 6 месяцев назад

      Yes. You should use hooks nowadays, his example uses old React class constructors that's no longer necessary or used by anyone worth their salt at React. Chances are the reasoning for this, like a lot of smaller channels making React tutorials, they just read off of some other guide or old documentation instead of creating their own lesson.

  • @lucifermorningstar1070
    @lucifermorningstar1070 2 года назад +8

    Wonderful explanation. Hats off !!
    But there's one thing I didn't get, why did you use class component inside HOC, it was functional component that you started with.
    So why not continue using functional components ??

  • @riversound8871
    @riversound8871 Год назад

    Bro, you are awesome. Make very clear understanding of HOC.

  • @S4LTYT
    @S4LTYT 3 года назад +1

    @Dipesh malvia please make a video on for going for job interview and also for freshers how they should start from first day

  • @jhs003
    @jhs003 Год назад

    Very easy explanation sir especially for beginners.. Make it little bit complicated

  • @meerabhaskaran8522
    @meerabhaskaran8522 2 года назад +1

    You have a very well structured way of teaching. Thanks for making complicated topics look easy. :)

  • @pushkarkumar5578
    @pushkarkumar5578 2 года назад +3

    Nice explanation Dipesh! Just one question. We can use functional components in HOC right?

  • @wayneswildworld
    @wayneswildworld 2 года назад +9

    Why would you all of a sudden switch to a class-based component?

  • @prasadchinthala1330
    @prasadchinthala1330 Год назад

    very informative video for React HOC... Thanks 🙂👍

  • @lesleykamamo182
    @lesleykamamo182 3 года назад +3

    You actually simplified things. Made the understanding of HOCs much easier.. thank you 😊

  • @prabhatsrivastava8510
    @prabhatsrivastava8510 2 года назад +1

    Very helpful, clean, best explanation 👏

  • @joedu7320
    @joedu7320 Год назад +1

    in the HOC, you passed the filtered Data to the WrappedComponent, even if its their first time render before you are typing any search term....

  • @codewithkaran8860
    @codewithkaran8860 4 месяца назад

    Why you use class component when you are using functional component it will be hard to grap both things at a time although you explain it very good and i hope everyone understand it properly great job bhaiya 😀❤

  • @vikasbairwa604
    @vikasbairwa604 2 года назад +1

    loved the way you explained this topic, thank you.

  • @jayantvasantkenjalkar6798
    @jayantvasantkenjalkar6798 Год назад

    Awesome, u explained it nicely !!

  • @MohitKumar-tn1cf
    @MohitKumar-tn1cf 3 года назад +2

    Really, you're doing great job !!

  • @rahul14021
    @rahul14021 Год назад +1

    Very well explained Appreciate .....

  • @srinivaspunith5996
    @srinivaspunith5996 2 года назад +1

    I Liked beginning and ending of the music of this video

  • @user121304
    @user121304 Год назад +2

    Nice Explanation! I have a doubt, Do we have to use class based components in HOC component ?

  • @yogesh19953
    @yogesh19953 3 года назад +2

    Hello sir, can you make video on javascript oops concepts like polymorphism, inheritance, etc with example, there is no good videos on this topic in youtube, also explain how this are used in reactjs. Thank you 😊

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

      React uses Composition rather then inheritance..
      ruclips.net/p/PLWrQZnG8l0E6mYguSNWHZEz7KrfZULz8d

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

    awsome dipesh really helped a lot thank you.

  • @SuccessWheels
    @SuccessWheels 2 года назад +3

    why did you create class component in HOC? why not functional component?

  • @osegocodes
    @osegocodes Год назад +1

    This has really been amazing Experience with Higher Order Components. Thank you for this great Video

  • @shin5302
    @shin5302 2 года назад +3

    Thank you for your excellent explanation. But I'm a little confused about something. Why don't you just return the functional component from the HOC component and use the useEffect hook instead?

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

    Clear explanation , thanks for this video !

  • @yashvanthkumar2576
    @yashvanthkumar2576 Год назад +1

    @Dipesh Malvia , Its well explained.

  • @ΠΑΝΑΓΙΩΤΗΣΜΗΤΡΟΠΑΝΟΣ

    I Have a question about the filteredData object inside the render function of the HOC...
    could we pass the property to be filtered as a prop of the HOC
    e.x. -> return d[props.FilterOnProperty].indexOf(term) >= 0;
    instead of using those if statements?

  • @yoscbd
    @yoscbd 3 года назад +1

    Thank you, that was very useful and informative for me! :)

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

    such a great video thank you soo much

  • @jamesmuhoro8568
    @jamesmuhoro8568 2 года назад +1

    Very well explained, I have understood HOC's for the first time.

  • @a4ankit27
    @a4ankit27 6 месяцев назад +1

    Is there a reason for creating HOC as a class component? Why didn't you use a functional component for HOC?

    • @DipeshMalvia
      @DipeshMalvia  6 месяцев назад

      There is no specific reason, I used the example which I build in my project so I used class component.

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

    This is pretty clear, thanks. Can you please make a video on server-side rendering and testing libraries too?🙂

  • @hiteshsuthar1097
    @hiteshsuthar1097 3 года назад +1

    Keep up this playlist just like it

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

    Great explanation

  • @divyadarbe
    @divyadarbe 3 года назад +1

    very well explained...

  • @coderevision3059
    @coderevision3059 Год назад +1

    functional component se class componnet pe kab aa gaye sir pata bhi nhi chala

  • @shakir8378
    @shakir8378 3 года назад +1

    Thanks for making it 💯

  • @nancy7160
    @nancy7160 Год назад +1

    Thanks :)

  • @abheemk
    @abheemk 3 года назад +1

    Hi Dipesh, wondering why you used class there

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

      Good question - I wanted to have states in my returned component but if I use function component than I cannot make use of useState hook. I will leave to you give a try and see what error you get.

    • @tausifkovadiya1810
      @tausifkovadiya1810 2 года назад +1

      Error will be : React Hook "useState" cannot be called inside a callback. React Hooks must be called in a React function component or a custom React Hook function.

    • @RinkaMizuki
      @RinkaMizuki Год назад

      @@tausifkovadiya1810 we can handle it. This error is because react doesn't understand when you return an anonymous component so in HOC component you should create a NewComponent and handle logic in return WrappedComponent and in HOC component return NewComponent. And problem solved

    • @RinkaMizuki
      @RinkaMizuki Год назад

      @@DipeshMalvia I'm sure it's possible because I did it

  • @regilearn2138
    @regilearn2138 3 года назад +1

    please do a Render Props video,Thanks

  • @________.pathfinder
    @________.pathfinder Год назад

    is it necessary to use class component?

  • @sachinkoli-3935
    @sachinkoli-3935 2 года назад +2

    can we use normal functional component for creating HOC ?

  • @manassahu576
    @manassahu576 3 года назад +2

    Feedback: Your voice is a little low in all of your videos, whereas your intro music is too loud. Please keep a balance of sound.

  • @DeepakGupta-pz4fx
    @DeepakGupta-pz4fx 3 года назад +1

    Please next video React authentication and Redux saga

  • @vinaykumar6916
    @vinaykumar6916 3 года назад +1

    Bro please make video on Rtk query with toolkit

    • @DipeshMalvia
      @DipeshMalvia  3 года назад +1

      Already add in my list.

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

      @@DipeshMalvia so when we will expect to come any idea

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

    Great

  • @shivangigoel4464
    @shivangigoel4464 11 дней назад

    Guys please help I am not sure why but in my case componentDidMount is not getting called with same example explained in video. Please share leads if any.
    thanks

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

    Sir is that equal to custom hook in function component version

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

    dipesh why you have used class based component in Hoc ? can we do that with functional component ?

  • @Gauravguptakumar
    @Gauravguptakumar 8 месяцев назад

    Very nice, clean and detailed explanation on HOC.

  • @ThandaTaco4505
    @ThandaTaco4505 10 месяцев назад

    why are you using class component for hoc?

  • @shucheendrat.m6024
    @shucheendrat.m6024 2 года назад

    Thank you

  • @dickyjayaumbara357
    @dickyjayaumbara357 3 года назад +2

    Hi sir, thank you for great video, i have a question, can we create extended class component in hoc contain like a useEffect, useState, etc, so we not using like componentDidMount?

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

    In userlist component you use two times return so my question is it possible??

  • @KamranAliMultani
    @KamranAliMultani Год назад

    why you are using class componen if you are working in funcitonal component!
    some people may stated learning on functional component!

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

    Wow!!! you are good at explaining things in simple way.Thanks so much :)

  • @prajwalpandeshwar9967
    @prajwalpandeshwar9967 Год назад

    Easy Explanation. Thanks!

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

    can we pass WrapperComponent state to HOC component ?

  • @137dylan
    @137dylan 2 года назад +1

    I like your videos, Dipesh, but this one frustrates me. The audio quality of your voice is low. Additionally, most of your screen is taken up by the sidebar, terminal and browser output. The code section of the IDE is very small, yet it's the most important thing for the viewer.

    • @DipeshMalvia
      @DipeshMalvia  2 года назад +2

      Apologies for that, I will be extra careful and take note of these points. Thank-you

  • @aashayamballi
    @aashayamballi 2 года назад +2

    Instead of creating HOC you could have created a custom hook for this.

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

      Yes, we could have create custom hook.

  • @Drayken
    @Drayken 6 месяцев назад

    Yeah man I'm not sure why this is linked in some of these React lesson lists when bro doesn't even know you don't need to "let" variables, as react renders entirely new instances of const variables, so you should just const them.
    The mixing of styles between useState and this.state also tells me he's probably just reading off of other people's old guides or docs and mix and matching stuff he doesn't actually understand. Not a fan, anyways just use custom hooks.

  • @nandinibagga5066
    @nandinibagga5066 Год назад +1

    jump to 16:10

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

    Why u have not return a functional component in hoc

  • @jazibbashar3332
    @jazibbashar3332 Год назад

    Everything is cleared but hoc componet Is not clear they that can understand how it's works

  • @rmt0858
    @rmt0858 2 года назад +1

    Hoc ko bhi functional component bna dete to kuch smjh ata

  • @shakilahmed6870
    @shakilahmed6870 Год назад

    You were using functional for the app,todoList,UserList and you jumped to class component immediately for the HOC component and you did not even explain why you did this. What a confusing tutorial

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

    Arey babu concept actually starts at 20:0

  • @JEEVRAJTARALKAR
    @JEEVRAJTARALKAR 8 месяцев назад

    Everything was good, until class based components came into picture and I felt like I wasted time

  • @khizrshaikh9902
    @khizrshaikh9902 3 года назад +1

    First I want heart

  • @MundiWay
    @MundiWay Год назад

    Video Start from 16:00////Edit: next 14 mins are also waste -_-.

  • @lalitgaikwad7238
    @lalitgaikwad7238 4 месяца назад

    nahi samza kuch bhi, HAHAHA

  • @sahilsharma1inspirationalTape
    @sahilsharma1inspirationalTape Год назад

    you always dissapoints

  • @abhinavgupta2455
    @abhinavgupta2455 Год назад

    I am new to React please help me what is this concept called.
    {profiles.map((profile) => {
    const userName = users[profile.userID].name;
    const favMovieName = movies[profile.favoriteMovieID].name;

  • @adarshtiwari7395
    @adarshtiwari7395 2 года назад +1

    Amazing explanation Dipesh! Just one question. We can use functional components in HOC right?