Skip to content

Minimal state management solution for React applications, built with Rust and compiled to WebAssembly (WASM)

Notifications You must be signed in to change notification settings

rust-dd/react-state-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-state-rs

Proof of concept React state manager in WebAssembly using Rust.

react-state-rs is a minimal state management solution for React applications, built with Rust and compiled to WebAssembly (WASM). It aims to leverage the performance and memory safety features of Rust to manage application state in React effectively.

Usage

Setting Up the State

import { create } from 'react-state-rs';

// Initialize the state
const store = create({ count: 0 });

function App() {
  const count = store((state) => state.count);

  return (
    <div>
      <h1>{count}</h1>
      <button onClick={() => store.setState({ count: count + 1 })}>
        Increment
      </button>
      <button onClick={() => store.setState({ count: count - 1 })}>
        Decrement
      </button>
    </div>
  );
}

export default App;

This is a simple proof of concept demonstrating how to manage state in React using Rust compiled to WebAssembly.

About

Minimal state management solution for React applications, built with Rust and compiled to WebAssembly (WASM)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages