This allows us to put HTML into JavaScript
JSX
What are the buildingblocks of any React app (reusable blocks of code?)
Components
Can you pass a function as a prop?
Yes
What is a React Hook?
A hook allows us to "hook" into React features such as state and lifecyle methods.
How do you output to your console?
console.log("like this!");
When __________ __________ is specified, the declaration that follwos is exported automatically and addtional modules will need to be exported by name.
export default
How many default class/component exports can you have per file?
1
What's the difference between a state and a prop in React?
States live in a component and determine when it re-renders; props can be passed from one component to another.
True or False: Hooks can be conditional
False: Hooks cannot be conditional as a rule
What is the difference between "let a = 5" and const a = 5"?
You can reassign the variable with let but not const.
Adding a file/module starts by declaring which keyword?
Import
When creating a component, what must be done for the component function to be recognized as a component?
The component function must have the first letter capitalized.
What is a stateful component and how is it different from a stateless one?
A component that holds or manipulates some state of the app is a stateful component. A stateless component does not manipulate any states.
This hook accepts an initial state and returns two values: The current state, and a function that updates the state.
useState hook
In JavaScript, how is "===" different from "=="?
"===" is a strict equality, which means both values must be of the same type.
What is the React Virtual DOM?
In React, for every DOM object, there is a corresponding “virtual DOM object.” A virtual DOM object is a representation of a DOM object, like a lightweight copy.
What does a function component return?
HTML elements wrapped inside a block element (e.g. div element)
What are props?
props are like function arguments in JavaScript and attributes in HTML. Props also allow you pass data from one component to another as parameters.
This hook allows you to perform side effects in your components and accepts two arguments. The second argument is optional.
useEffect hook
True or False: Arrays are objects with more methods?
True
Where does React hold the createRoot() function in the Create React App?
index.js
What is the correct pseudo-element syntax for returning a component inside another component function return, using bicycle as the returned component?
<Bicycle />
What should you use to manipulate the state of your react app?
Use a hook e.g. useState
This hook is primarily used for performance optimization.
useMemo hook
The value "NaN" in JavaScript is of what datatype?
Number. NaN is not equal to anything - even itself.