React Redux Flashcards

1
Q

What is React?

A
  • Open-source frontend Javascript library

- SPA (Single Page Application)

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

What are the major features of React?

A
  • Virtual DOM
  • Unidirectional dataflow
  • Reusability & composability
  • — Lego bricks
  • Isomorphic (server-side rendering)
  • — Splits up the bundle for faster initial load
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is JSX?

A
  • Infused with Javascript & XML/HTML syntax
  • — XML = markdown language
  • — Syntactic sugar for creating elements
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the difference between a component & element?

A
  • React mainly uses components

- Elements are the immutable version

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

What is state?

A
  • Holds information

- It can change over the lifetime of a component

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

What are props?

A
  • Inputs to components
  • They are always passed down
  • Unidirectional dataflow
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the difference between props & state?

A
  • Locally, state can change

- — Props can’t

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

What is the difference between HTML & React events?

A
  • lowercase vs camelCase

- Native events vs Synthetic Events

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

What are Synthetic Events?

A
  • A wrapper around HTML native events

- So the Virtual DOM can track changes

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

What are conditional expressions?

A
  • Ternary (true ? ‘yes ‘ : ‘no’)
  • &&
  • ||
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is ‘key’ used for?

A
  • Unique key

- — Helps in fetching & changing that specific element

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

What are refs?

A
  • They provide a reference to a real DOM node
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How to create refs

A
  • useRef hook

- React.createRef

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

What is the Virtual DOM

A
  • Javascript binary tree version of the DOM tree
  • Listens for component events (Synthetic events)
  • Selectively updates the real DOM instead of refreshing the entire thing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are controlled components?

A
  • Component value is tracked by React state
  • — Props
  • — State
  • — Context
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are uncontrolled components?

A
  • Components whose value is tracked by HTML itself

- Traditional HTML

17
Q

What is “lifting up state”?

A
  • Letting parents know about changes in child’s state
  • Pass down handlers
  • Context
18
Q

What is context?

A
  • State mechanism
  • — To avoid prop drilling
  • ——- Passing props multiple layers down
  • Providers & Consumers
19
Q

What are the different phases of a component lifecycle?

A
  • Mounting
  • Updating (Reacting)
  • Unmounting
  • **Render
  • —Part of all the cycles
20
Q

What are higher order components (HOCs)

A
  • Functions that take components and return components

- It wraps reusable functionality around a component

21
Q

What are children props?

A
  • Pass component tree between opening & closing tags as prop data
22
Q

What are the core principles of Redux?

A
  • Reducers are pure functions
  • Global store is the single source of truth
  • Store is immutable
23
Q

What is the difference between mapState & mapDispatch?

A
  • mapState = read props

- mapDispatch = write props (actions)

24
Q

How does “connect()” work?

A
  • Takes in
  • — mapState
  • — mapDispatch
  • —Component to be wrapped