ReactPatterns & Best Practices

72 items

1

Component Composition with children Prop

Slides / Video
2

Render Prop Rendered as Element

Code Quiz
3

Container Forgets to Pass Data

Code Quiz
4

PropTypes and TypeScript for Type Safety

Slides / Video
5

Immutability in State Updates

Slides / Video
6

Separating Business Logic from UI

Slides / Video
7

Small Single-Responsibility Components

Slides / Video
8

Naming Conventions for Components and Files

Slides / Video
9

Folder and File Organization Strategies

Slides / Video
10

Three React Anti-Patterns to Avoid

Slides / Video
11

Deriving State Instead of Duplicating

Slides / Video
12

Colocating State Near Usage

Slides / Video
13

React.memo for Component Memoization

Slides / Video
14

Compound Component Pattern

Slides / Video
15

Proper Use of Keys in Lists

Slides / Video
16

Conditional Rendering Best Practices

Slides / Video
17

Lifting State Up

Slides / Video
18

Container vs Presentational Components

Quiz
19

Fragments Avoid Wrapper Divs

Quiz
20

Accessibility in Component Design

Quiz
21

Inline Functions in Render

Quiz
22

Error Boundaries

Quiz
23

Immutable State Updates

Quiz
24

Colocating State

Quiz
25

Deriving State Instead of Duplicating

Quiz
26

Single Responsibility Components

Quiz
27

Component Folder Structure

Quiz
28

Composition over Inheritance

Quiz
29

Prop Drilling and Context

Quiz
30

Lifting State Up

Quiz
31

Controlled vs Uncontrolled Inputs

Quiz
32

Compound Components Pattern

Quiz
33

Render Props Pattern

Quiz
34

Higher-Order Components Basics

Quiz
35

Higher-Order Components (HOCs)

Slides / Video
36

Container/Presentational Pattern

Slides / Video
37

HOC Swallows the Props

Code Quiz
38

Compound Component Loses Context

Code Quiz
39

Controlled Input Without onChange

Code Quiz
40

Lifting State That Stayed Local

Code Quiz
41

Prop Drilling Passes Wrong Name

Code Quiz
42

Composition Ignores Children

Code Quiz
43

Barrel Export Missing the Component

Code Quiz
44

State Lifted Too High

Code Quiz
45

Component Doing Too Much

Code Quiz
46

Modal Rendered Without a Portal

Code Quiz
47

Wrong PropType for Callback

Code Quiz
48

Fragment Loses the Key

Code Quiz
49

List Key on the Wrong Element

Code Quiz
50

Card Component Ignores Children

Code Quiz
51

Lazy Component Without Suspense

Code Quiz
52

Error Boundary as a Function

Code Quiz
53

Derived Value Stored in State

Code Quiz
54

Inline Object Defeats Memoization

Code Quiz
55

React.memo That Never Memoizes

Code Quiz
56

Zero Leaks Into the UI

Code Quiz
57

Provider Pattern for Shared State

Flashcard
58

Default Props and Prop Validation

Flashcard
59

Fragments to Avoid Wrapper Nodes

Flashcard
60

Extracting Reusable UI Components

Flashcard
61

Prop Drilling and Avoiding It

Flashcard
62

Lifting State Up

Flashcard
63

Colocating State

Flashcard
64

React.memo Best Practices

Flashcard
65

Compound Components Pattern

Flashcard
66

Deriving State

Flashcard
67

Prop Naming & API Design

Flashcard
68

Render Props Pattern

Flashcard
69

Small, Focused Components

Flashcard
70

Container/Presentational Pattern

Flashcard
71

Component File Organization

Flashcard
72

Avoiding Inline Functions/Objects

Flashcard
FlashcardIntermediate

Lifting State Up

Moving shared state to the closest common parent component.

Question

What does 'lifting state up' mean in React?

Click to reveal answer