
Product
Socket for Jira Is Now Available
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.
react-native-global-store
Advanced tools
A lightweight and efficient global state management solution for React Native with built-in AsyncStorage persistence.
React Native Global Store is a lightweight and efficient global state management solution for React Native with built-in AsyncStorage persistence. It provides an easy-to-use API for managing state globally without the complexities of Redux or Context APIs.
useState.connect.useGlobalStore.npm install react-native-global-store
- OR -
yarn add react-native-global-store
No linking or Pods required. Ready to use!
Wrap your app with GlobalStoreProvider to provide global state management.
| Prop | Type | Default | Description |
|---|---|---|---|
initialState | object | {} | Initial state for the store. |
persistedKeys | string[] | [] | Keys to persist in AsyncStorage. |
loadingUI | JSX.Element | <View /> | UI to display while loading persisted state. |
storageKey | string | "GlobalStoreProvider" | Unique key for AsyncStorage. |
import React from "react";
import { GlobalStoreProvider } from "react-native-global-store";
import App from "./App";
const myInitialState = { theme: "light" };
const Root = () => (
<GlobalStoreProvider
initialState={myInitialState}
loadingUI={<LoadingComponent />}
persistedKeys={["theme"]}
>
<App />
</GlobalStoreProvider>
);
export default Root;
A hook for accessing and updating the global state in functional components.
import React from "react";
import { useGlobalStore } from "react-native-global-store";
import { Text, Button } from "react-native";
const MyComponent = () => {
const [globalState, setGlobalState] = useGlobalStore();
return (
<>
<Text>Current Theme: {globalState.theme}</Text>
<Button title="Toggle Theme" onPress={() =>
setGlobalState({ theme: globalState.theme === "light" ? "dark" : "light" })
} />
</>
);
};
export default MyComponent;
A higher-order component (HOC) for connecting class components to the global store.
import React, { Component } from "react";
import { View, Text, Button } from "react-native";
import { connect } from "react-native-global-store";
class SettingsScreen extends Component {
render() {
const { theme, setGlobalState } = this.props;
return (
<View>
<Text>Current Theme: {theme}</Text>
<Button title="Toggle Theme" onPress={() =>
setGlobalState({ theme: theme === "light" ? "dark" : "light" })
} />
</View>
);
}
}
export default connect(SettingsScreen);
MIT
Contributions are welcome! Feel free to open issues or submit pull requests.
FAQs
A lightweight and efficient global state management solution for React Native with built-in AsyncStorage persistence.
We found that react-native-global-store demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.