react-elements Flashcards

1
Q

What is React?

A

a JS 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 (what gets returned from components)

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()

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

If you forget to import React, it will be undefined and the createElementcall will fail.
bc jsx isnt JS and need to be reconfigured

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

babel pugin transform react

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

What is a React component?

A

a javascript function, reusable

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 `ComponentName` {
return
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

reactDOM.render

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

What are props in React?

A

arguments passed in react components, used to pass data from component to component

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

props = ‘value’

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

{expression}

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

How do you create “class” component in React?

A
class `componentName` extends React.component {
    render ( ) {
       return  {this.props.text} ;
    }
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
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