Understanding the Base Features & Syntax Flashcards

1
Q

Optimized code means?

A

Small as possible. Increasing the performance of the app. (It increases the performance of the app)

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

Next-Gen JavaScript is…

A

ES6 and above

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

What are “dependencies”

A

third party packages

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

JSX

A

JavaScript rendition of HTML. Syntax extension to JavaScript.

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

What is the first and second parameter of the ReactDOM.render();

A

ReactDOM.render(What do I want to render, Where do I want to render it);

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

JSX produces React ______.

A

elements

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

What is the boilerplate for importing react?

A

import React from “react”

import ReactDOM from “react-dom”

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

SPAs

A

Single Page Applications

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

MPAs

A

Multi Page Applications

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

npm or yarn is an example of?

A

Dependency Management Tools

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

What is a compiler?

A

a conversion software that converts next-gen javascript to older version so it runs on any browsers that the user is on.

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

Babel is an example of?

A

Compiler

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

npm start

A

starts the development server

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

npm run build

A

Bundles the app into static files for production

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

npm test

A

Starts the test runner

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

npm run eject

A

Removes this tool and copies build dependencies, configuration files and scripts into the app directory. (If you do this, you can’t go back!)

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

What is a React Component?

A

A component is either a Function or a Class that produces HTML to show the user using JSX and handles feedback from the user using event handlers.

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

How do you start a React app?

A

Run npm start in the project directory

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

How do you create a React app?

A

In the terminal: create-react-app project-name

20
Q

T or F: Every react component has to return or render some html code which can be rendered.

21
Q

createElement() is a method that takes at least __ arguments.

A

3.
Argument 1: The element we want to render to the dom
Argument 2: The configuration for 1
Argument 3: Any amount of children (Whats nested under argument 1.

22
Q

Function names in components should be uppercased or lowercased?

A

lowercased

23
Q

T or F: When you’re importing a component, the name should be the same as the component file.

24
Q

What are Props?

A

Changes from outside the component(data passed into component)
eg.)

25
React is a library for creating _______.
components
26
A typical React app could be depicted as a component tree- having one ____ component("App") and then an infinite amount of nested child components.
root
27
Each React component needs to return/render some ____ code.
JSX
28
T or F: JSX is HTML
False. JSX is a syntactic sugar for JavaScript, allowing you to write HTMLish code instead of nested React.createElement(...) calls.
29
When creating a component, what are the two different ways?
1. Functional components | 2. Class-based components
30
What are Functional Components?
aka presentational, dumb, or stateless components. ``` const cmp = () => { return
some JSX
} } ``` * often used- best practice
31
What are class-based components?
``` aka containers, smart, or stateful components. class Cmp extends Component { render() { return
JSX
} } ```
32
Only changes in ____ and/or _____ trigger React to render your components and potentially update the DOM
props, state
33
What are Props?
It allows you to pass data from a parent(wrapping) component to a child(embedded) component. Triggers UI updates
34
What are States?
State is used to change the component, state from within. Changes to state also rigger an UI update.
35
Only ____-based components can define and use state
class
36
State is simply a _____ of the component class.
property
37
Whenever state changes, the component will ____ and reflect the new state. The difference to props is, that this happens within one andthe same component - you don't receive new data (props ) from outside!
re-render
38
React is a JavaScript library for building?
A JavaScript library for building user interfaces
39
Which library lets React connect to and update the DOM? a. React DOM b. Create React App c. Babel d. Webpack
a. React DOM
40
Which method creates and returns a React element of the given type? a. createElement() b. create() c. createNode() d. ReactDOM.render()
a. createElement()
41
True or False: React creates actual DOM nodes.
False. React creates objects that describe DOM nodes
42
T or False: React manipulates and updates the DOM directly.
False. React only manages what gets rendered to the DOM via ReactDOM.render. It's the job of render() to interpret the element objects and create DOM nodes out of them.
43
Which method renders React elements to the DOM? a. React.render() b. DOM.render() c. ReactDOM.render() d. React.createElement()
c. ReactDOM.render()
44
{}
JavaScript within JSX
45
What tool do we use to translate JSX into standard JavaScript? a. Create React App b. React DOM c. Babel d. React CDN
c. Babel
46
Is using JSX with React optional?
Yes
47
What is the purpose of curly braces {} in JSX?
They are used to evaluate JavaScript expressions.