React.js Flashcards

1
Q

What is React?

A

A JavaScript library for building user interfaces

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

What is a React Element?

A

An object that describes an element

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

How do you mount a react element to the DOM?

A

ReactDOM.render() method

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

What is React’s lifecycle?

A

it’s what happens to a component over the course of it’s lifetime

Mount:
what happens when the component is first introduced to the page

Updating:
what happens when the component is interacted with or changed by the user

Unmounting:
what happens when the component finishes

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

What two props must you pass to an input for it to be “controlled”?

A

Value, onChange

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

What are controlled components?

A

input elements that are controlled by React,

controlled by Value and onChange

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

What Array method is commonly used to create a list of React elements?

A

array.prototype.map()

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

What is the best value to use as a “key” prop when rendering lists?

A

ideally, a property key that makes the object unique from it’s siblings

ie:
index, number

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

When does React call a component’s componentDidMount method?

A

after the first successful render

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

Name three React.Component lifecycle methods.

A

componentDidMount(), componentDidUpdate(), componentWillMount()

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

How do you pass data to a child component?

A

through props

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