Explore Library
React NativeState Management

92 items

1

useState Hook Basics

Code Quiz
2

Context Performance Pitfalls & Re-renders

Slides / Video
3

Avoiding Unnecessary Re-renders

Quiz
4

Managing Derived State

Quiz
5

useContext Hook Consumption

Quiz
6

Memoizing Derived Values

Quiz
7

Persisting State with AsyncStorage

Quiz
8

Redux Toolkit Slices

Quiz
9

Redux Core Concepts

Quiz
10

Global State Libraries Overview

Quiz
11

Controlled TextInput State

Quiz
12

Preserving and Resetting State

Quiz
13

State vs Props Distinction

Quiz
14

useRef for Mutable State

Quiz
15

useEffect for Side Effects

Quiz
16

Context Provider Re-render Pitfalls

Quiz
17

Context API for Shared State

Quiz
18

useState vs useReducer

Quiz
19

useReducer for Complex Logic

Quiz
20

Lifting State Up

Quiz
21

Immutable State Updates

Quiz
22

Functional Updates with Previous State

Quiz
23

State Updates Are Asynchronous

Quiz
24

useState Hook Fundamentals

Quiz
25

Creating and Providing Context

Slides / Video
26

useContext Hook Basics

Slides / Video
27

Context API for Global State

Slides / Video
28

The Prop Drilling Problem

Slides / Video
29

Lifting State Up to Share Between Components

Slides / Video
30

useReducer for Complex State Logic

Slides / Video
31

useState Hook for Local Component State

Slides / Video
32

Custom Hooks for Reusable Stateful Logic

Slides / Video
33

useEffect for Syncing State with Side Effects

Slides / Video
34

Persisting State with AsyncStorage

Slides / Video
35

Async State & Data Fetching Patterns

Slides / Video
36

Choosing Local, Context, or External Store

Slides / Video
37

Zustand as a Lightweight State Library

Slides / Video
38

useSelector & useDispatch Hooks

Slides / Video
39

Actions, Reducers, and Dispatch

Slides / Video
40

Updating Array State

Code Quiz
41

useCallback for Stable Handlers

Code Quiz
42

Batching of State Updates

Code Quiz
43

Stale Closure in Updates

Code Quiz
44

useRef for Non-Rendering State

Code Quiz
45

useEffect for State Sync

Code Quiz
46

Context Provider Value Setup

Code Quiz
47

useContext Hook Consumption

Code Quiz
48

Passing Setters as Callbacks

Code Quiz
49

Dispatching Actions

Code Quiz
50

useReducer for Complex State

Code Quiz
51

Multiple vs Single State Object

Code Quiz
52

Lazy Initial State

Code Quiz
53

Updating Object State

Code Quiz
54

Functional State Updates

Code Quiz
55

Lifting State Up

Code Quiz
56

Passing State Down via Props

Code Quiz
57

Context API for Global State

Code Quiz
58

Derived State from Props

Code Quiz
59

useMemo for Derived Values

Code Quiz
60

Redux Toolkit for Simplified Setup

Slides / Video
61

Redux Fundamentals & Store Concept

Slides / Video
62

Functional Updates with Previous State

Slides / Video
63

Persisting State with AsyncStorage

Flashcard
64

State vs Props

Flashcard
65

Lifting State Up

Flashcard
66

Redux Persist Rehydration

Flashcard
67

Derived State and Selectors

Flashcard
68

Batching of State Updates

Flashcard
69

Redux Core Concepts

Flashcard
70

Zustand Lightweight State

Flashcard
71

useReducer for Complex State

Flashcard
72

Custom Hooks for Stateful Logic

Flashcard
73

MobX Observable State

Flashcard
74

Async Updates with useEffect

Flashcard
75

Choosing State Scope

Flashcard
76

Server State with React Query

Flashcard
77

Sharing State Across Screens

Flashcard
78

Avoiding Stale Closures

Flashcard
79

useSelector and useDispatch

Flashcard
80

Context API for Global State

Flashcard
81

Provider Placement and Composition

Flashcard
82

Recoil and Jotai Atoms

Flashcard
83

Functional Updates

Flashcard
84

Immutability When Updating State

Flashcard
85

Redux Toolkit Setup

Flashcard
86

Creating and Consuming Context

Flashcard
87

Context Performance Pitfalls

Flashcard
88

Prop Drilling Problem

Flashcard
89

useRef for Mutable State

Flashcard
90

Immutability in State Updates

Slides / Video
91

State vs Props Distinction

Slides / Video
92

useRef for Non-Rendering State

Slides / Video
Code QuizIntermediate

useState Hook Basics

Spot why a counter never updates the screen when its button is pressed.

Codejavascript
import React, { useState } from 'react';
import { View, Text, Button } from 'react-native';

function Counter() {
  const [count, setCount] = useState(0);

  const increment = () => {
    count = count + 1;
  };

  return (
    <View>
      <Text>{count}</Text>
      <Button title="Add" onPress={increment} />
    </View>
  );
}

export default Counter;

What is the bug that stops the counter from updating on screen?