Lifecycle Method componentWillMount

Hello,
Use the Lifecycle Method componentWillMount

I didn’t understand the aim of this exercice.
This is my console.log:
image
So what ? :thinking: :face_with_peeking_eye:

Hey there!
The understanding of component lifecycles may become handy later on.
Depending on what you application needs to the, you may need certain actions to happen before it mounts and maybe finish after it mounts.
Think for example of a component that takes a long time to load, you could load a spinner using this hook / start some animation perhaps and then finish the animation on a different hook.

The idea behind this exercise is to introduce the notion of hooks. Every component in react has a bunch of those, depending on which we are talking about it will have different use cases :wink: Hope that helps a bit.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.