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

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

create React element,
query the dom for html element
pass the dom element to ReactDOM root object
root.render(element

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

What is JSX?

A

Javascript syntax extension used to create React element

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

Why must the React object be imported when authoring JSX in a module?

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

How can you make Webpack and Babel work together to convert JSX into valid JavaScript?

A

use Babel loader to hook it up to Webpack and

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

What is a React component?

A

Javascript expression

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

How do you define a function component in React?

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

How do you mount a component to the DOM?

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

How do you create “class” component in React?

A

How do you access props in a class component?

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

What are props in React?

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

How do you pass props to a component?

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

How do you write JavaScript expressions in JSX?

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

What is the purpose of state in React?

A

To keep track of things that change over time

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

How to you pass an event handler to a React element?

A

pass an event handler as a prop to an element
whatever you’re listening for
javascript expression

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