ReactPatterns & Best Practices

79 items

1

Props spreading and forwarding patterns

Code Quiz
2

Higher-Order Components (HOC) pattern

Flashcard
3

Render Props Pattern

Slides / Video
4

0 && x renders 0: use a real boolean

Quiz
5

Why key={index} breaks row state

Quiz
6

Why key={index} breaks row state

Flashcard
7

0 && x renders 0: use a real boolean

Flashcard
8

Component Composition with children Prop

Slides / Video
9

Container Forgets to Pass Data

Code Quiz
10

Render Prop Rendered as Element

Code Quiz
11

PropTypes and TypeScript for Type Safety

Slides / Video
12

Immutability in State Updates

Slides / Video
13

Separating Business Logic from UI

Slides / Video
14

Small Single-Responsibility Components

Slides / Video
15

Naming Conventions for Components and Files

Slides / Video
16

Folder and File Organization Strategies

Slides / Video
17

Three React Anti-Patterns to Avoid

Slides / Video
18

Deriving State Instead of Duplicating

Slides / Video
19

Colocating State Near Usage

Slides / Video
20

React.memo for Component Memoization

Slides / Video
21

Compound Component Pattern

Slides / Video
22

Proper Use of Keys in Lists

Slides / Video
23

Conditional Rendering Best Practices

Slides / Video
24

Lifting State Up

Slides / Video
25

Deriving State Instead of Duplicating

Quiz
26

Single Responsibility Components

Quiz
27

Accessibility in Component Design

Quiz
28

Compound Components Pattern

Quiz
29

Immutable State Updates

Quiz
30

Inline Functions in Render

Quiz
31

Colocating State

Quiz
32

Controlled vs Uncontrolled Inputs

Quiz
33

Render Props Pattern

Quiz
34

Error Boundaries

Quiz
35

Component Folder Structure

Quiz
36

Prop Drilling and Context

Quiz
37

Fragments Avoid Wrapper Divs

Quiz
38

Higher-Order Components Basics

Quiz
39

Container vs Presentational Components

Quiz
40

Lifting State Up

Quiz
41

Composition over Inheritance

Quiz
42

Higher-Order Components (HOCs)

Slides / Video
43

Container/Presentational Pattern

Slides / Video
44

HOC Swallows the Props

Code Quiz
45

Controlled Input Without onChange

Code Quiz
46

Lifting State That Stayed Local

Code Quiz
47

Compound Component Loses Context

Code Quiz
48

Composition Ignores Children

Code Quiz
49

Prop Drilling Passes Wrong Name

Code Quiz
50

Barrel Export Missing the Component

Code Quiz
51

Component Doing Too Much

Code Quiz
52

State Lifted Too High

Code Quiz
53

Modal Rendered Without a Portal

Code Quiz
54

Fragment Loses the Key

Code Quiz
55

Wrong PropType for Callback

Code Quiz
56

Error Boundary as a Function

Code Quiz
57

Lazy Component Without Suspense

Code Quiz
58

Zero Leaks Into the UI

Code Quiz
59

Inline Object Defeats Memoization

Code Quiz
60

Card Component Ignores Children

Code Quiz
61

React.memo That Never Memoizes

Code Quiz
62

List Key on the Wrong Element

Code Quiz
63

Derived Value Stored in State

Code Quiz
64

Extracting Reusable UI Components

Flashcard
65

Provider Pattern for Shared State

Flashcard
66

Default Props and Prop Validation

Flashcard
67

Fragments to Avoid Wrapper Nodes

Flashcard
68

Prop Drilling and Avoiding It

Flashcard
69

Compound Components Pattern

Flashcard
70

Deriving State

Flashcard
71

Lifting State Up

Flashcard
72

Container/Presentational Pattern

Flashcard
73

Avoiding Inline Functions/Objects

Flashcard
74

Colocating State

Flashcard
75

Component File Organization

Flashcard
76

Small, Focused Components

Flashcard
77

Prop Naming & API Design

Flashcard
78

React.memo Best Practices

Flashcard
79

Render Props Pattern

Flashcard
QuizIntermediate

Why key={index} breaks row state

Using array index as a key can cause React to mismatch component state when the list reorders.

You render a list of editable input rows using key={index}. After deleting the first item, why might the remaining rows show the wrong input values?