React component lifecycle: React lifecycle methods & hooks

React lifecycle method explained

  • Mounting, that is putting inserting elements into the DOM.
  • Updating, which involves methods for updating components in the DOM.
  • Unmounting, that is removing a component from the DOM.

Class components vs functional components

Mounting in the React component lifecycle

Updating in the React component lifecycle

  1. You call setState() in the componentDidUpdate() method.
  2. The component is updated.
  3. componentDidUpdate() is invoked.
  4. setState() is called again …

Unmounting in the React component lifecycle

React component lifecycle with hooks

Class components vs hooks (is there a clear victor?)

--

--

--

I'm a Developer who is Interested in Web Development. I call Myself a Learner because I don't put a limit to Learn anything.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

7 Best React UI Library You Should Use in Your Next Project

🎉 Good Things Come to Those Who Wait: What’s new in Transloco

Wallpaper Laptop Aesthetic Black

Realtime ‘Likes’ with Angular and Firebase

Web Push Notification Full Stack Application With Node Js Restful API

Gameplan Your JavaScript Code

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Shaik Nadeem

Shaik Nadeem

I'm a Developer who is Interested in Web Development. I call Myself a Learner because I don't put a limit to Learn anything.

More from Medium

What is React?

How & when to use redux in react projects?

Basics of React