Installation
TanStack Store provides a core package and framework-specific adapters. Install the adapter for your framework to get started.
All TanStack Store packages require TypeScript 5.6+ for the best development experience.
Framework Adapters
Choose the adapter for your framework:
React
Vue
Solid
Angular
Svelte
Preact
React Install the React adapter which includes the core package: npm install @tanstack/react-store
Requirements
React : 16.8+ (React 18+ recommended)
React DOM : 16.8+ (React 18+ recommended)
The React adapter is compatible with React 16.8+, 17, 18, and 19. It uses useSyncExternalStore for optimal concurrent rendering support. TanStack Store for React is currently compatible with ReactDOM only. If you’d like to contribute a React Native adapter, please reach out on Discord . Peer Dependencies The following peer dependencies are required: {
"react" : "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" ,
"react-dom" : "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
}
Vue Install the Vue adapter which includes the core package: npm install @tanstack/vue-store
Requirements TanStack Store supports both Vue 2 and Vue 3 through vue-demi. Peer Dependencies For Vue 2.x (below 2.7), you also need the Composition API plugin: npm install @vue/composition-api
{
"vue" : "^2.5.0 || ^3.0.0" ,
"@vue/composition-api" : "^1.2.1" // Optional for Vue 2.7+
}
Vue 2.7+ has built-in Composition API support, so the plugin is not needed.
Solid Install the Solid adapter which includes the core package: npm install @tanstack/solid-store
Requirements TanStack Store is compatible with Solid and SolidStart. Peer Dependencies Angular Install the Angular adapter which includes the core package: npm install @tanstack/angular-store
Requirements The Angular adapter requires Angular 19 or later.
Svelte Install the Svelte adapter which includes the core package: npm install @tanstack/svelte-store
Requirements TanStack Store is compatible with Svelte 5. Preact Install the Preact adapter which includes the core package: npm install @tanstack/preact-store
Requirements TanStack Store is compatible with Preact 10 and later.
Core Package Only
If you want to use TanStack Store without a framework (vanilla JavaScript/TypeScript) or build your own adapter, install just the core package:
npm install @tanstack/store
The core package has zero dependencies and can be used in any JavaScript environment.
import { createStore } from '@tanstack/store'
const store = createStore ({ count: 0 })
store . setState (( prev ) => ({ count: prev . count + 1 }))
console . log ( store . state . count ) // 1
TypeScript Configuration
For the best TypeScript experience, ensure you’re using TypeScript 5.6 or later. TanStack Store is tested against TypeScript 5.6, 5.7, 5.8, and 5.9.
No additional TypeScript configuration is required. All packages include full type definitions.
Verify Installation
After installation, verify everything works by creating a simple store:
import { Store } from '@tanstack/react-store'
const store = new Store ({ count: 0 })
console . log ( 'TanStack Store installed successfully!' )
Next Steps
Now that you have TanStack Store installed, let’s build your first store:
Quickstart Guide Learn how to create and use stores in your application