Skip to content
Ashish Uttam edited this page Apr 22, 2021 · 17 revisions

react-form-use hook

A simple hook for your react forms.

Basic usage

You can use the hook to simply create the state of your input control or build the whole form using the hook. Following example shows creating a single field for an input control -

import React from "react";
import { useForm } from "react-form-use";

const App = () => {
  const {
    fields: [myField],
  } = useForm([{ name: "myField" }]);

  return <input value={myField.value} onChange={myField.handleChange} />;
};

Check API page for more details.

More Examples

Clone this wiki locally