Skip to content

dva

A lightweight React and Redux framework that organizes app state in an Elm-like style.

Stars
16.1k
Forks
3.1k
Licence
MIT
Language
JavaScript
Last update
1.3 years ago
Type
Library

No commits in over a year — check for forks or alternatives before adopting.

What it is

dva is a front-end framework built on top of redux, redux-saga, and react-router. It groups app logic into models that contain reducers, effects, and subscriptions, which is meant to make state handling in React apps simpler. The README says it is inspired by Elm and choo.

  • Structure a multi-page dashboard with models for users, orders, and similar data
  • Handle async calls such as API requests through effects that use redux-saga
  • Show loading indicators automatically with the dva-loading plugin
  • Use the dva-hackernews or user-dashboard examples as starting references

Great for

  • React developers already familiar with Redux who want less boilerplate
  • Teams maintaining admin dashboards or enterprise-style web apps
  • Developers who want built-in hot module replacement for components, routes, and models
  • Projects that want a plugin system, such as the dva-loading plugin for loading states

Not ideal for

  • Beginners who are new to React and Redux, since the concepts stack up quickly
  • Projects that need to support IE8, which the README explicitly says is not supported
  • Developers starting a new project who want a framework with current, active documentation, since the README points to a docs directory and older blog posts rather than a detailed guide
Step-by-step guide: how to use dvaInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Install with a package manager

    You'll need: Node.js · npm or yarn

    Install dva from npm

    npm install dva
  2. 2

    Run it

    • Install the dva package from npm
    • Read the Concepts guide in the docs directory to understand models, reducers, effects, and subscriptions
    • Create a model and register it with your app
    • Start from the Count demo on StackBlitz to see a working example
  3. 3

    Get the most out of it

    • Read the 8 Concepts document to see how the parts connect
    • Use babel-plugin-dva-hmr for hot reloading of models and routes
    • Add the dva-loading plugin to track loading state without writing it by hand
    • Look at the User Dashboard example in the repository for a fuller app structure

Downloads

Strengths

  • The README describes only six APIs, which keeps the surface area small for Redux users
  • Models separate reducers, effects, and subscriptions in a clear, Elm-inspired way
  • Includes HMR support for components, routes, and models, and a plugin system

Trade-offs

  • The README's Quick Start only links to a docs directory, so setup detail is limited in the README itself
  • The README notes the project was built around Alibaba's internal use, and the Redux/saga stack adds concepts to learn
  • Last push date is 2025-08-06, but the README does not state the current maintenance status or supported React versions

How it compares

ProjectStarsTypeLevelUpdatedBest for
dva (this)16.1kLibraryintermediate1.3 years agoReact developers already familiar with Redux who want less boilerplate
redux-toolkit11.2kLibraryintermediate4 days agoDevelopers already using or learning Redux for app state
zustand58.9kLibrarybeginner15 days agoReact developers who want simpler shared state than Redux
mobx28.2kLibraryintermediate5 days agoFrontend developers building React apps with complex or frequently changing state
Recoil19.4kLibraryintermediate1.8 years agoReact developers who want shared state beyond simple prop passing
redux-saga22.4kLibraryintermediate11 days agoReact or other frontend developers already using Redux who need to manage async logic

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.