React JS Tutorial for Beginners | Life Cycle Methods

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

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

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

    Keep going

  • @knecks7374
    @knecks7374 9 месяцев назад

    Do these methods still find use in modern react?

    • @WebTechTalk
      @WebTechTalk  9 месяцев назад +1

      Nowadays react developers are using functional hooks. In older applications only these component lifecycle methods were used. Also I am out of React for more than a year and so I am not sure whether component lifecycle methods are still in use. I didn't explore the recent versions of react.

    • @knecks7374
      @knecks7374 9 месяцев назад +1

      @@WebTechTalk oh ok , thanks for replying. Nowadays usage of hooks is preferred over everything else. These component lifecycle methods can come in use in some really specific instances.

    • @WebTechTalk
      @WebTechTalk  9 месяцев назад +1

      @@knecks7374 Even Angular is also moving towards functional

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

    ComponentDidMount(run only once before DOM print to screen)==ngOninit
    ComponentWillUnmount==ngOndestroy
    ComponentDidUpdate(runs for every update)==?
    ShouldComonentUpdate(true-compinent update,false-component won't update)==?
    Is my understanding correct sir .
    What is angular equivalent of didUpdate and ShouldComonentUpdate?

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

      You can't directly compare the lifecycle methods bro. But as you have already related, you can think of DidUpdate as change detection in angular. So, you can relate to DoCheck. But not completely. DoCheck runs for every change detection. But DidUpdate runs only when there is a change in props or state. Should component update is a react specific lifecycle to decide whether to run DidUpdate or not.

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

      @@WebTechTalk great explanation sir

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

      @@WebTechTalk 1)then what about ngAgterView Init,initChecked,contentInit,content Checked-how do we implement those in React
      2) Directives,pipes all are not available how they implement it in React

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

      @@karthikrachamadugu5275 Don't confuse Angular with React bro. Both are totally different.

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

      @@karthikrachamadugu5275 Thank you