@dhmk/cell-react

React integration for @dhmk/cell

Usage no npm install needed!

<script type="module">
  import dhmkCellReact from 'https://cdn.skypack.dev/@dhmk/cell-react';
</script>

README

@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>
  );
};