You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[](https://github.com/gokulakannant/react-form-input-validation/blob/master/LICENSE.md)[](https://gitter.im/react-form-input-validation/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
6
6
7
-
A customized [validatorjs](https://www.npmjs.com/package/validatorjs) library to validate the react forms. It uses the [Controlled Components](https://reactjs.org/docs/forms.html#controlled-components) approach for validation.
7
+
A customized [validatorjs](https://www.npmjs.com/package/validatorjs) library to validate the react forms. It uses the both [Controlled Components](https://reactjs.org/docs/forms.html#controlled-components) and React Hooks approach for validation.
*[Demo](https://codesandbox.io/s/react-form-input-validation-demp-hyuju?fontsize=14&hidenavigation=1&theme=dark) (in CodeSandbox)
11
+
*[Demo - Class Components](https://codesandbox.io/s/react-form-input-validation-demp-hyuju?fontsize=14&hidenavigation=1&theme=dark) (in CodeSandbox)
12
+
*[Demo - Functional Components](https://codesandbox.io/s/useforminputvalidation-kn0xe3) (in CodeSandbox)
12
13
13
14
## Why use react-form-input-validation?
14
15
15
16
* JQuery Free.
16
17
* Auto Controlled State.
18
+
* Able to use in both State and Stateless components.
17
19
* Compatible with libraries like [Material UI](https://material-ui.com/), and etc.
18
20
* Readable and declarative validation rules which is inspired by laravel framework.
19
21
* Error messages with multilingual support.
@@ -37,7 +39,9 @@ Using [yarn](https://yarnpkg.com/en/) as your package manager.
37
39
38
40
## Usage
39
41
40
-
A example form has given below. View all available apis in [documentation](https://gokulakannant.github.io/react-form-input-validation/classes/reactforminputvalidation.html).
42
+
### Class component
43
+
44
+
The given below example is for Class component. View all available apis in [documentation](https://gokulakannant.github.io/react-form-input-validation/v2.1.0/classes/ReactFormInputValidation.ReactFormInputValidation.html).
41
45
42
46
```js
43
47
importReactfrom"react";
@@ -124,6 +128,183 @@ class ValidationForm extends React.Component {
124
128
}
125
129
```
126
130
131
+
### Functional Component
132
+
133
+
The given below example is for Functional component with the usage of hooks. View all available apis in [documentation](https://gokulakannant.github.io/react-form-input-validation/v2.1.0/functions/Hooks.useFormInputValidation.html).
0 commit comments