Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
getspooky authored Sep 30, 2020
1 parent df5a51c commit 4bc88b2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ Let's define some validations in React components
```jsx
import React, { useState } from 'react';
import { useValidate } from 'reactrix';
// Custom React Component to display messages.
import { Alert } from './AlertComponent';

function Login(props) {
const [data, setData] = useState({});
Expand All @@ -63,12 +65,11 @@ function Login(props) {
email: 'required|email',
password: 'required|string'
});

}


return (
<form>
<form onSubmit={handleSubmit}>
<div className="container">
<label>Email : </label>
<input type="email" placeholder="Enter Email" name="email" onChange={handleChange} />
Expand All @@ -77,6 +78,7 @@ function Login(props) {
<button type="submit" onClick={handleSubmit}>Login</button>
Forgot <a href="#"> password? </a>
</div>
<Alert data={msg} />
</form>
);

Expand Down Expand Up @@ -128,6 +130,9 @@ export { default as es } from '../locale/spanish.json';
## 🚦Common Rules
This is the list of all the rules you can validate form inputs against. When using multiple rules, separate them with a pipe `|`.
| Keyword | Description |
|------------------|:----------------------------------------------------------------------------------------------------------------|
| **Common Validator** |
Expand Down

0 comments on commit 4bc88b2

Please sign in to comment.