Scrimba Course FCC Flashcards

1
Q

Why do we need to import React from “react”

A

React is what defines JSX

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

What is wrong with this code:

const page = (
<h1>Hello</h1>
<p>This is my website!</p>
)

A

We need our jsx nested under a single parent element

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

What does it mean for something to be “declarative” instead of “imperative”?

A

Declarative means I can tell the computer WHAT to do
and expect it to handle the details. Imperative means I need
to tell it HOW to do each step.

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

What does it mean for something to be “composable”?

A

We have small pieces that we can put together to make something
larger/greater than the individual pieces.

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

How to use Vite?

A

‘npm create vite@latest’
give project name
select framework
select varient
run commands
‘npm run dev’ to run

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

How to use map on an array

A

const arr = theArr.map(arrItem => do something)

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

What is state?

A

State is a way for react to remember saved values from within a component.

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

What do you get when you log React.useState()?

A

You get an array of “[undefined, f()]”

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

How do you destruction the React.useState() array?

A

const [someName, setSomeName] = React.useState(“the name”);
console.log(someName), result: the name

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