import React from "react"; // import { useSetState } from "pluto-hooks"; import useSetState from "../index"; export default () => { const [state, setState] = useSetState({ hello: '', count: 0, }); return (
{JSON.stringify(state, null, 2)}
setState({ hello: 'world' })}> set hello setState({ foo: 'bar' })} style={{ margin: '0 8px' }}> set foo setState((prev) => ({ count: prev.count + 1 }))}> count + 1