1.0.0 • Published 2 years ago

@feierstoff/react-form v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

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
1.0.0

2 years ago