React
React Components
States and Props
React Hooks
JavaScript
100

This allows us to put HTML into JavaScript

JSX

100

What are the buildingblocks of any React app (reusable blocks of code?)

Components

100

Can you pass a function as a prop?

Yes

100

What is a React Hook?

A hook allows us to "hook" into React features such as state and lifecyle methods.

100

How do you output to your console?


console.log("like this!");

200

When __________ __________ is specified, the declaration that follwos is exported automatically and addtional modules will need to be exported by name.

export default

200

How many default class/component exports can you have per file?

1

200

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.

200

True or False: Hooks can be conditional

False: Hooks cannot be conditional as a rule

200

What is the difference between "let a = 5" and const a = 5"?

You can reassign the variable with let but not const.

300

Adding a file/module starts by declaring which keyword?

Import

300

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.

300

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.

300

This hook accepts an initial state and returns two values: The current state, and a function that updates the state.

useState hook

300

In JavaScript, how is "===" different from "=="?

"===" is a strict equality, which means both values must be of the same type.

400

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.

400

What does a function component return?

HTML elements wrapped inside a block element (e.g. div element)

400

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.



400

This hook allows you to perform side effects in your components and accepts two arguments. The second argument is optional.

useEffect hook

400

True or False: Arrays are objects with more methods?

True

500

Where does React hold the createRoot() function in the Create React App?

index.js

500

What is the correct pseudo-element syntax for returning a component inside another component function return, using bicycle as the returned component?

<Bicycle />

500

What should you use to manipulate the state of your react app?

Use a hook e.g. useState

500

This hook is primarily used for performance optimization.

useMemo hook

500

The value "NaN" in JavaScript is of what datatype?

Number. NaN is not equal to anything - even itself.