6) Master Project: Forms + Components Flashcards

1
Q

How should you name a variable in a file that only contains data? give an example, and what would the export statement for the example be?

A

all caps with a underscore to separate words.

Ex:

SHOP_DATA

export default SHOP_DATA

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

How do make an array only show x amount of items in it.

A

array.filter((item, idx) => idx < x)

this returns the items in the array up until x

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

git command line statement for checking what files need to be committed?

A

git status

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

staging commits in the command line

A

git add -A

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

making a commit in the command line

A

git commit -m “brief explanation”

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

what react router dom object import object replaces the functionality of the a tag?

A

<link></link>

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

step-wise process and making a pushing a commit. (4)

A
  1. git status
  2. git add -A
  3. git commit -m “message”
  4. git push origin master
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

what component do you import when you want to use an SVG as a react component?

A

import { ReactComponent as Logo } from “../../assets/image.svg”;

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

git command for checking out a commit.

A

git checkout <hash-or-ref></hash-or-ref>

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

sign in is a combination of creating ___ and doing ___

A

forms

user authentication

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

What are mixins, and give a syntax example?

A

a way of declaring and defining a block of CSS code

@mixin shrinkLabel {

top: -14px;

font-size: 12px;

color: $main-color;

}

@include shrinkLabel();

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

what is …otherProps used for?

A

all of the props that are not explicitly destructured off the props object will be spread into an object name “otherProps”

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

What is the “children” attribute of a component?

A

anything wrapped inside of it

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