@beikai/react
v0.0.1
Published
This library contains hooks to work with beikai form. It's a wrapper with `react-hook-form`
Downloads
3
Readme
beikai-react
This library contains hooks to work with beikai form. It's a wrapper with react-hook-form
Usage
const { submit, onSubmit, register, handleSubmit } = useBeikai({
formId: 'beikai-form-id'
})
// native submit
return (
<form onSubmit={onSubmit}>
<input {...register('data')} />
</form>
}
// custom submit
return (
<form onSubmit={handleSubmit(async (data) => {
await submit(data)
})}>
<input {...register('data')} />
</form>
}
Running unit tests
Run nx test beikai-react
to execute the unit tests via Jest.