Nanostores
nanostores
A tiny (372 bytes) state manager for React/Preact/Vue/Svelte with many atomic tree-shakable stores
React Native Libraries
preact
react
react native
state
state manager
store
svelte
vue
nanostores
React Native Libraries
Stars
786
Weekly
7.8M
Open issues
10
Bundle
~15 kB
Installation
npm install nanostoresCode example
import { View, Text, StyleSheet } from "react-native";
import { Nanostores } from "nanostores";
export function Example() {
return (
<View style={styles.box}>
<Text style={styles.title}>Nanostores</Text>
<Nanostores />
</View>
);
}
const styles = StyleSheet.create({
box: { flex: 1, alignItems: "center", justifyContent: "center", gap: 8 },
title: { fontSize: 18, fontWeight: "600" },
});Pros & cons
Pros
- Actively maintained by Andrey Sitnik
- 7.8M weekly downloads. Battle tested
- First-class TypeScript definitions
- MIT licensed
Considerations
- Adds roughly ~15 kB to your bundle
- Needs client-only rendering in SSR frameworks
- 10 open issues on GitHub