@feierstoff/react-form
v1.0.0
Published
```shell script npm i @feierstoff/react-form ```
Downloads
2
Readme
Install
npm i @feierstoff/react-form
Quickstart
Setting up form
function Form() {
const submit = () => {
// validate form and stop execution of next steps
if (form.showViolations()) return;
}
const form = useForm("form", submit);
}
Registering input to form
<Input label="Input" {...form.register("inputId", {
init: "optional init value",
constraints: [
new Constraint.NotBlank("Bitte gib etwas ein.")
]
})}/
Todo
- [ ] make sure submitting by return is working