Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/abdheshnayak/react-useform

easy to use react hook to mange form inputs, validations and api calls.
https://github.com/abdheshnayak/react-useform

form handling react use-form use-form-hook validation

Last synced: 14 days ago
JSON representation

easy to use react hook to mange form inputs, validations and api calls.

Awesome Lists containing this project

README

        

# React Form Hook

## example

```jsx
import React from 'react';
import * as yup from 'yup';
import useForm from '@kavre/react-useform';

const App = () => {
const {
values,
errors,
handleChange,
handleSubmit,
resetValues,
submit,
setValues,
} = useForm({
initialValues: {
name: '',
},
validationSchema: yup.object({
name: yup.string().required(),
}),
onSubmit: async (values) => {
console.log(values);
resetValues();
},
});
return (


Submit

{errors.name &&

{errors.name}

}

);
};

export default App;
```