An Intro to React Flashcards

1
Q

Can JSX be interpreted by the browser?

A

No it cannot since it’s in ES6

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

What would you need to dependency inject for transpiling JSX and ES6 TO ES5?

A

Webpack and Babel

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

Explain the modern JavaScript tooling flow

A

JavaScript files in ES6 with React and Redux libraries. They are transpiled through webpack and backed by babel.js. They take ES6 code, can’t be ran into browser, and transpile to be ran in a browser. Spits out some single file that says ‘hey here is your file that can be ran’

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

What is JSX?

A

It is called JSX, and it is a syntax extension to JavaScript. We recommend using it with React to describe what the UI should look like. JSX may remind you of a template language, but it comes with the full power of JavaScript.

JSX produces React “elements”. We will explore rendering them to the DOM in the next section. Below, you can find the basics of JSX necessary to get you started.

Creates the html that gets inserted in the DOM when we render a component. Render = ‘place this components HTML onto the page’

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

What is REPL?

A

A Read–Eval–Print Loop (REPL), also known as an interactive toplevel or language shell, is a simple, interactive computer programming environment that takes single user inputs (i.e. single expressions), evaluates them, and returns the result to the user; a program written in a REPL environment is executed piecewise.

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

What are JavaScript modules?

A

Siloed files that need import (ES6) in order to talk to each other

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

What is the difference between REACT and REACT-DOM

A

React library is core. It knows how to work with components, how to render and nest them as well on a SPA

Reac-DOM library is how to render to the DOM

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

What design pattern are you utilizing when you create a component?

A

A factory that is a class that can produce instances of components

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

What is a component?

A

Each component is a function or object that returns some amount of HTML. Ideally, it will be rendered in the DOM after instantiating

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

How many components per file?

A

ALWAYS ONE!

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

What does the following code do?

npm install –save youtube-api-search

A

Goes into the npm registry and installs this package for us

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

What is a functional component?

A

Component with inputs with a return of JSX

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

When to use functional component vs class component?

A

Class when you need added functionality. Class extends Component and must render with JSX

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

Explain the dynamic of browser events

A

All browser events that get triggered by native elements like div, span, input..whenever you add an event handler, they’re always called with an event object.

The event object describes the context or information about the event that occured. Very specific, very technical properties inside of it.

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

What is state?

A

A plain JavaScript object that is used to record and react to user events.

Each class based component that we define has it’s own state based object. Whenever a component has changed it immediately rerenders and forces all of its children to rerender as well

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

What is downward data flow?

A

Means only the most parent component in the application should be responsible for fetching data be it form an API or from flux or redux, etc.

17
Q

What is passing props?

A

When a child when instantiated under parent (video_list under Apps) the data that we’re passing into a component

18
Q

How would you handle null props?

A

You can make an if check on the children components to wait until there is a load

19
Q

What is a reducer?

A

Is a function that returns a piece of the application state. Because our application can have many different pieces of state, we can have many different reducers

20
Q

Why do we need react-redux?

A

It forms the bridge to react and redux. React are the views, redux is the models (data) utilizing reducers to pull data

21
Q

What is a container in redux?

A

Component that has direct access to the state that’s produced by redux