React.JS Flashcards

1
Q

What is JSX?

A

JSX is a syntax extension to JavaScript which helps describe what the UI should look like in HTMLish style.

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

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

A

React and JSX go hand in hand. JSX creates react elements.

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

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

A

add babel as a loader under the webpack exports object and add the jsx transform plugin so that it compiles the JSX to JavaScript.

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

What is a React component?

A

They are JavaScript functions that return React elements describing what should appear on the screen.

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

How do you define a function component in React?

A

define a function then use JSX to create the dom elements you need for that component

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

How do you mount a component to the DOM?

A

using the render method of the ReactDOM object

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

What are props in React?

A

it is the object you pass through a element creation that lists attributes and children

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

How do you pass props to a component?

A

as a parameter in the component function definition

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

How do you write JavaScript expressions in JSX?

A

by surrounding them in curly braces.

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