
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
react-tauri-store
Advanced tools
This repository provides a simple way to integrate Tauri's local storage (via the [Tauri Store plugin](https://v2.tauri.app/plugin/store/) ) into your React application. It exposes a [React context provider](https://react.dev/reference/react/createContext
This repository provides a simple way to integrate Tauri's local storage (via the Tauri Store plugin ) into your React application. It exposes a React context provider and a custom hook so you can easily manage application state that persists on disk.
Install tauri-plugin-store and setup tauri::Builder
Install the frontend package via npm or other package manager
npm install react-tauri-store
This setup is designed to make it straightforward for developers using React and Tauri to manage application state that persists locally while reducing boilerplate code.
After installation, wrap your application's root component with the TauriStoreProvider. This provider loads your persistent state asynchronously from the specified file and automatically saves any state changes back to store file on user application directory.
import { TauriStoreProvider } from "react-tauri-store";
ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
<React.StrictMode>
<TauriStoreProvider
filePath="settings.json"
defaultValues={{ count: 0 }}
>
<App />
</TauriStoreProvider>
</React.StrictMode>,
);
Within any descendant component, use the useTauriStore hook to access and modify the persistent state. For example:
import { useTauriStore } from "react-tauri-store";
function App() {
const { state, set, reset, clear } = useTauriStore<{
count: number;
key?: string;
object?: { k: string };
}>();
// Add a new key "key" without modifying the existing state
const addKey = () => {
set({ key: "new_value" });
};
// Update the existing "key" and add/update the "object" key
const updateKeys = () => {
set({ count: state.count + 1 });
set({ key: "updated_value", object: { k: "v" } });
};
return (
<div>
{state.count !== undefined ? <p>Count: {state.count}</p> : null}
{state.key !== undefined ? <p>Key: {state.key || "not set"}</p> : null}
{state.object !== undefined ? <p>Object: {state.object ? JSON.stringify(state.object) : "not set"}</p> : null}
<button type="button" onClick={addKey}>
Add Key
</button>
<button type="button" onClick={updateKeys}>
Update Key
</button>
<button type="button" onClick={reset}>
Reset to Default Values
</button>
<button type="button" onClick={clear}>
Clear All Keys
</button>
</div>
);
}
export default App;
TauriStoreProvider
filePath: Location of the store file.defaultValues (optional): Initial state object.useTauriStore Hook
{ key: value }).state: The current store state.dispatch: The raw dispatch function.set: A shorthand setter that automates the creation of action objects.reset: A shorthand setter that resets the state to the initial values provided to the provider.clear: A shorthand setter that clear all keys from state.FAQs
This repository provides a simple way to integrate Tauri's local storage (via the [Tauri Store plugin](https://v2.tauri.app/plugin/store/) ) into your React application. It exposes a [React context provider](https://react.dev/reference/react/createContext
The npm package react-tauri-store receives a total of 1 weekly downloads. As such, react-tauri-store popularity was classified as not popular.
We found that react-tauri-store demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.