@anywidget/react
v0.1.0
Published
React utilities for anywidget
Downloads
2,684
Readme
@anywidget/react
React utilities for anywidget
Installation
npm install @anywidget/react
Usage
import * as React from "react";
import { createRender, useModelState } from "@anywidget/react";
function Counter() {
let [value, setValue] = useModelState("value");
return <button onClick={() => setValue(value + 1)}>count is {value}</button>;
}
const render = createRender(Counter);
export default { render };
License
MIT