fullstack Flashcards

1
Q

What is a React component?

A

a JavaScript class or function that optionally accepts inputs i.e. properties(props) and returns a React element that describes how a section of the UI (User Interface) should appear

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

How do you define a function component in React?

A

write it as a function or us an ES6 class

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

How do you mount a component to the DOM?

A

By using ReactDOM.render()

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

What are props in React?

A

props are inputs that can taken as arguments for components

Object

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

How do you write JavaScript expressions in JSX?

A

by using curly braces

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

a string that uniquely identifies a list item among its siblings

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

How do you create “class” component in React?

A

Create an ES6 class that extends React.Component.
Add a single empty method to it called render().
this.props in the render() body.

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

How do you access props in a class component?

A

this.props

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

What is the purpose of state in React?

A

It represents the parts of the app that can change

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

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

A

render(){

}

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

what is super

A

super is the constructor of the class you are extending

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