import React from 'react'
import { useStore, getState } from 'stook'
function submitUser() {
const name = getState('[UserForm]')
alert(name)
}
export const UserForm = () => {
const [name, setName] = useStore('[UserForm]', 'initial name')
return (
<div>
<input type="text" value={name} onChange={e => setName(e.target.value)} />
<button onClick={submitUser}>Submit</button>
</div>
)
}