0Pricing
Vue Academy · Lesson

Pinia vs Vuex: Why the Switch

No mutations, TypeScript inference, devtools support, simpler API, modular by default.

Why Pinia Replaced Vuex

Pinia is the official state management library for Vue 3, recommended over Vuex. It keeps the good parts of Vuex but removes the boilerplate and the parts that fought against TypeScript.

No More Mutations

Vuex required mutations as the only way to change state. Pinia drops them entirely — actions mutate state directly. Less ceremony, fewer files, same devtools tracking.

// Vuex: state -> mutation -> action (3 steps)
// Pinia: action mutates state directly (1 step)
actions: {
  increment() {
    this.count++ // direct, no commit needed
  }
}

All lessons in this course

  1. Pinia vs Vuex: Why the Switch
  2. defineStore: State, Getters, Actions
  3. Composing Stores and Cross-Store Access
  4. Pinia Persistence and Devtools
← Back to Vue Academy