Basic over view Flashcards

1
Q

What are Components ?

A

Basically JavaScript classes with a state and a render

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

What does a class look like

A

Class Name { state: {}; render () {} }

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

What is the render( ) { }

A

Method to a react element

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

What is a react element

A

a plan Java script obj that maps to DOM element

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

How many DOM are there

A

Virtual DOM and real Dom, children must be kept in order

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

Where is the root container held

A

In the index.html file

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

What extends app.js ?

A

extends by Component at built in Java Script class

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

How to write app class

A

Class App extends Component {render() { returns JSX;
}}

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

What is babel

A

A modern java script compiler

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

how to make a bisc react element

A

const element = <> </>;

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

Import React from ‘react’; which is the module and obj

A

React obj ‘react’ is module

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

2 obj that must be imported

A

React
ReactDOM

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

What is hot module reloading, t

A

This is where react uses babbel to to compile JavaScript objects directly on the fly

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

What are the two arguments in react Dom

A

Element, document get Element by ID

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

Shortcut for import react component

A

I MRC

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

Shortcut for class components

17
Q

How to rap to html elements togeather

A

React.Fragment

18
Q

State is an object and what does it hold ?

A

properties

19
Q

What is an expression

A

Javascript the expression references the state or function object using this keyword

20
Q

Example of object destructuring

A

const { count } = this.state;

21
Q

How to write if for state count

A

return count === 0 ? “Zero” : count;

22
Q

How to render a list of tags [ ]

A

this.state.tags.map(
(tag) => (<li key={tag}>{tag}</li>

23
Q

What is setting attributes

A

className = / styles

24
Q

If && operator is applied second True is printed out

A

True && “ hi”

25
When is undefined declared as an error ?
When " this " is outside of an object. this refers to the Method inside an object.
26
Why write an arrow function
Due to event handlers are out of scope
27
What does an arrow function look like
handleIncreament = () => { console.log("clicked"); this.setState({ count: this.state.count + 1 }); };
28
How to use map function
[ ].map to each obj => ()
29
What does every react component have
props
30
Components can or cannot modify own state?
The component that owns a piece of the state should be the one modifying it
31
What is the difference between state and properties ?
state is local to that component, props are not.
32
how to make a button
button.btn.btn-danger.btn-sm.m-2