Skip to content

Latest commit

 

History

History

react

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

@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