Styling React Component, Props, & States Flashcards

1
Q

A _______ renders a reusable piece of the UI.

a. JSX tag
b. JSX expression
c. Component
d. Module

A

c. Component

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

How do you create a React component?

A

As either a JavaScript function or class

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

T or F: React uses a templating language for creating components.

A

False. React components are written in plain JavaScript, with the help of JSX

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

Which component do you usually pass to ReactDOM.render()?

A

Top-level component

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

When should you break a component into smaller components?

A

When the component has too many responsibilities.

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

When a component contains other components, it’s called:

A

Composition

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

Why is a capital letter necessary in the component name?

A

To differentiate custom components from native DOM elements

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