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.

A

True

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.

A

True

24
Q

What are Props?

A

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

25
Q

React is a library for creating _______.

A

components

26
Q

A typical React app could be depicted as a component tree- having one ____ component(“App”) and then an infinite amount of nested child components.

A

root

27
Q

Each React component needs to return/render some ____ code.

A

JSX

28
Q

T or F: JSX is HTML

A

False. JSX is a syntactic sugar for JavaScript, allowing you to write HTMLish code instead of nested React.createElement(…) calls.

29
Q

When creating a component, what are the two different ways?

A
  1. Functional components

2. Class-based components

30
Q

What are Functional Components?

A

aka presentational, dumb, or stateless components.

const cmp = () => {
return <div> some JSX</div> }
}
  • often used- best practice
31
Q

What are class-based components?

A
aka containers, smart, or stateful components. 
class Cmp extends Component {
render() {
return <div>JSX</div> }
}
32
Q

Only changes in ____ and/or _____ trigger React to render your components and potentially update the DOM

A

props, state

33
Q

What are Props?

A

It allows you to pass data from a parent(wrapping) component to a child(embedded) component. Triggers UI updates

34
Q

What are States?

A

State is used to change the component, state from within. Changes to state also rigger an UI update.

35
Q

Only ____-based components can define and use state

A

class

36
Q

State is simply a _____ of the component class.

A

property

37
Q

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!

A

re-render

38
Q

React is a JavaScript library for building?

A

A JavaScript library for building user interfaces

39
Q

Which library lets React connect to and update the DOM?

a. React DOM
b. Create React App
c. Babel
d. Webpack

A

a. React DOM

40
Q

Which method creates and returns a React element of the given type?

a. createElement()
b. create()
c. createNode()
d. ReactDOM.render()

A

a. createElement()

41
Q

True or False: React creates actual DOM nodes.

A

False. React creates objects that describe DOM nodes

42
Q

T or False: React manipulates and updates the DOM directly.

A

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
Q

Which method renders React elements to the DOM?

a. React.render()
b. DOM.render()
c. ReactDOM.render()
d. React.createElement()

A

c. ReactDOM.render()

44
Q

{}

A

JavaScript within JSX

45
Q

What tool do we use to translate JSX into standard JavaScript?

a. Create React App
b. React DOM
c. Babel
d. React CDN

A

c. Babel

46
Q

Is using JSX with React optional?

A

Yes

47
Q

What is the purpose of curly braces {} in JSX?

A

They are used to evaluate JavaScript expressions.