React lifecycle Flashcards

1
Q

What is the “mount” phase of the component lifecycle?

A

When a React component renders to the DOM for the first time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

When does a components unmounting period occur?

A

A component’s unmounting period occurs when the component is removed from the DOM.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a common reason for a component to be removed from the DOM?

A

When the DOM re-renders without the component.

For example when you change page in a React app lots of components will not be displayed, they will be unmounted.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the three stages of the React lifecycle?

A

mounting, updating, and unmounting.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Does a component always go through every stage of the React lifecycle?

A

No, a React component may not go through every phase. For example, a component could be mounted one minute and then unmounted the next   without any updates or error handling.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly