What We're Building Today

We're adding three things to SolScan:

  1. Global State with Zustand: Share data between any screen without prop drilling
  2. Persistent Storage: Save data to the phone so it survives app restarts
  3. Practical Features: Favorites, search history, devnet toggle, and a watchlist

By the end, your SolScan app will feel like a real app people would actually use.


Why Do We Need This?

Right now in our SolScan app:

Problem 1: Data doesn't survive restarts. Search for a wallet, close the app, open it — gone. Users hate this.

Problem 2: Screens can't share data. If you favorite a wallet on the Explorer tab, the Settings tab has no idea. You'd have to pass props through every layout, which gets ugly fast.

Problem 3: No offline capability. If the user loses internet, the app shows nothing. A real app should show the last known data.

Solution: Zustand for global state + MMKV for persistence. These two together give you an offline-first app where data flows everywhere and survives restarts.


Part 1: Zustand — Global State Made Simple

What is Zustand?

Zustand (German for "state") is a tiny state management library. Think of it as React Context but without the boilerplate and re-render problems.

Why not Context? Context re-renders every component that uses it when ANY value changes. Zustand only re-renders components that use the specific value that changed. In a list of 100 items, this is the difference between smooth and janky.

Why not Redux? Redux is powerful but requires actions, reducers, dispatchers, middleware, and a lot of boilerplate. Zustand does the same thing in 10 lines.