0.0.1 • Published 3 years ago

@dhmk/cell-react v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

@dhmk/cell-react

React integration for @dhmk/cell

import { cell } from "@dhmk/cell";
import { useCells } from "@dhmk/cell-react";

const counter = cell(1);

const App = () => {
  useCells(counter);

  return (
    <div>
      <h1>{counter()}</h1>
      <button onClick={() => counter.set(counter() + 1)}>click</button>
    </div>
  );
};