Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/abdheshnayak/react-useform
- Owner: abdheshnayak
- License: mit
- Created: 2022-08-07T06:25:05.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-23T04:47:59.000Z (over 1 year ago)
- Last Synced: 2025-01-16T11:28:14.604Z (15 days ago)
- Topics: form, handling, react, use-form, use-form-hook, validation
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/@kavre/react-useform
- Size: 47.9 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
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;
```