6) Master Project: Forms + Components Flashcards
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?
all caps with a underscore to separate words.
Ex:
SHOP_DATA
export default SHOP_DATA
How do make an array only show x amount of items in it.
array.filter((item, idx) => idx < x)
this returns the items in the array up until x
git command line statement for checking what files need to be committed?
git status
staging commits in the command line
git add -A
making a commit in the command line
git commit -m “brief explanation”
what react router dom object import object replaces the functionality of the a tag?
<link></link>
step-wise process and making a pushing a commit. (4)
- git status
- git add -A
- git commit -m “message”
- git push origin master
what component do you import when you want to use an SVG as a react component?
import { ReactComponent as Logo } from “../../assets/image.svg”;
git command for checking out a commit.
git checkout <hash-or-ref></hash-or-ref>
sign in is a combination of creating ___ and doing ___
forms
user authentication
What are mixins, and give a syntax example?
a way of declaring and defining a block of CSS code
@mixin shrinkLabel {
top: -14px;
font-size: 12px;
color: $main-color;
}
…
@include shrinkLabel();
what is …otherProps used for?
all of the props that are not explicitly destructured off the props object will be spread into an object name “otherProps”
What is the “children” attribute of a component?
anything wrapped inside of it