React Flashcards

1
Q

What is React?

A

JavaScript library. Its aim is to allow developers to easily create fast user interfaces for websites and applications alike.

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

What is a react element?

A

It is an object representation of a virtual DOM node.

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

render()

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

What is JSX?

A

a syntax extension to Javascript

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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a React component?

A

A re-useable UI elements for a React app. It lets you combine your markup, CSS, and JavaScript.

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

function name() {
return (content in here);
}

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

root.render(

<component></component>

);

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

What are props in React?

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

How do you pass props to a component?

A

as an argument

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

How do you write JavaScript expressions in JSX?

A

{ content }

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

What is the purpose of state in React?

A

It is essentially a components storage.

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

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

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

What is a React Effect?

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

When should you use an Effect and when should you not use an Effect?

A
17
Q

When do effects run?

A

they run at the end of the render.

18
Q

What function is used to decalre an Effect?

A

useEffect (callback function and array dependency

19
Q

What are Effect dependencies and how do you declare them?

A
20
Q

How do you cleanup from an Effect?

A