Rendering Elements Flashcards

1
Q

What is the smallest building block of a React app?

A

Element

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

Unlike browser DOM elements, React elements are plain ______?

A

Objects! They are cheap to create and React DOM takes care of updating the DOM to match the React elements.

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

What is the name of the DOM node where everything inside it will be managed by React DOM?

A

Root.

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

Can you have more than one root DOM node?

A

Applications built with just React usually have a single root DOM node.

However, ff you are integrating React into an existing app, you may have as many isolated root DOM nodes as you like.

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

What is the ReactDOM method used to render an element to the page?

A

ReactDOM.render()

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

True/False? React elements are immutable

A

True. Once you create an element, you can’t change its children or attributes. An element is like a single frame in a movie: it represents the UI at a certain point in time.

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

Given the following example, when setInterval fires, what will be updated?

A

Only the time! React DOM compares the element and its children to the previous one, and only applies the DOM updates necessary to bring the DOM to the desired state.

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