React Fundamentals Flashcards

1
Q

Features of React

A

JSX

components

virtual DOM

DOM

one way data-binding

high performance

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

JSX

A

syntax extension of Javascript used in React. Allows us to write HTML and JS in the same file. Web browsers cannot read JSX directly. They can only read regular JS objects. For a web browser to read a JSX file, the file must be transpiled into a regular JavaScript object via a transpiler like Babel

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

components

A

splits user interface into independent reusable parts that can be processed separately

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

virtual DOM

A

lightweight representation of the real DOM. When state changes, the virtual DOM changes only that object in the real DOM instead of re-rendering the entire DOM

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

DOM

A

Document object model, an HTML document with a tree structure. Each branch leads to a node. Each node contains objects (Objects can be in JS not JSX)

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

one way data-binding

A

Unidirectional flow . When data flows in one direction, it’s easier to debug errors and ID the root cause quickly

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

high performance

A

react apps only re-render components that have state change instead of all components within a tree.

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

useState

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

useEffect

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

useCallback

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

useMemo

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

Rules of hooks

A

Don’t call hooks inside loops, conditions or nested functions

Only call hooks from react functional components or custom hooks

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

React hooks are internally implemented as a _____

A

queue

React hooks are internally implemented as a queue, which each hook represented as a book having the reference to the next one (linked list, anyone?). This is way react hooks relies on the order in which hooks are called, and why they must be called on the top level of our components.

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

True or false;

On each render, React keeps a copy of the dependency array and compares it with the previous dependency array. Objects are compared by reference, not value

A

True

On each render, React keeps a copy of the dependency array and compares it with the previous dependency array. Objects are compared by reference, not value

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

True or false

Sometimes it’s better to create a function in useEffect if it’s only being used inside of useEFfect. It prevents the function from being created each time the component that uses the context hook usecontext is created

A

True

Sometimes it’s better to create a function in useEffect if it’s only being used inside of useEFfect. It prevents the function from being created each time the component that uses the context hook usecontext is created

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