-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into field-array-low-priority-validation
- Loading branch information
Showing
11 changed files
with
1,007 additions
and
471 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import React from 'react'; | ||
import { ErrorMessage, Field, Form, Formik } from 'formik'; | ||
import * as Yup from 'yup'; | ||
|
||
const SignIn = () => ( | ||
<div> | ||
<h1>Sign In</h1> | ||
|
||
<Formik | ||
validateOnMount={true} | ||
initialValues={{ username: '', password: '' }} | ||
validationSchema={Yup.object().shape({ | ||
username: Yup.string().required('Required'), | ||
password: Yup.string().required('Required'), | ||
})} | ||
onSubmit={async values => { | ||
await new Promise(r => setTimeout(r, 500)); | ||
alert(JSON.stringify(values, null, 2)); | ||
}} | ||
> | ||
{formik => ( | ||
<Form> | ||
<div> | ||
<Field name="username" placeholder="Username" /> | ||
<ErrorMessage name="username" component="p" /> | ||
</div> | ||
|
||
<div> | ||
<Field name="password" placeholder="Password" type="password" /> | ||
<ErrorMessage name="password" component="p" /> | ||
</div> | ||
|
||
<button type="submit" disabled={!formik.isValid}> | ||
Submit | ||
</button> | ||
</Form> | ||
)} | ||
</Formik> | ||
</div> | ||
); | ||
|
||
export default SignIn; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,14 @@ | ||
# formik-native | ||
|
||
## 2.1.10 | ||
|
||
### Patch Changes | ||
|
||
- [`00f95ec`](https://github.com/formium/formik/commit/00f95ec4ec5266eed8ad4e97b76321205c704d51) [#2854](https://github.com/formium/formik/pull/2854) Thanks [@umidbekkarimov](https://github.com/umidbekkarimov)! - Fix low priority validation race condition. | ||
|
||
- Updated dependencies [[`00f95ec`](https://github.com/formium/formik/commit/00f95ec4ec5266eed8ad4e97b76321205c704d51)]: | ||
- [email protected] | ||
|
||
## 2.1.9 | ||
|
||
### Patch Changes | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "formik-native", | ||
"version": "2.1.9", | ||
"version": "2.1.10", | ||
"license": "Apache-2.0", | ||
"author": "Jared Palmer <[email protected]>", | ||
"repository": "formium/formik", | ||
|
@@ -31,13 +31,13 @@ | |
"react": ">=16.8.0" | ||
}, | ||
"dependencies": { | ||
"formik": "2.2.1" | ||
"formik": "2.2.2" | ||
}, | ||
"devDependencies": { | ||
"@react-native-community/eslint-config": "^0.0.5", | ||
"@types/react": "^16.8.23", | ||
"@types/react-native": "^0.57.65", | ||
"react": "^16.8.6", | ||
"@types/react": "^16.9.55", | ||
"@types/react-native": "^0.63.32", | ||
"react": "^17.0.1", | ||
"react-native": "https://github.com/expo/react-native/archive/sdk-33.0.0.tar.gz" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "formik", | ||
"description": "Forms in React, without tears", | ||
"version": "2.2.1", | ||
"version": "2.2.2", | ||
"license": "Apache-2.0", | ||
"author": "Jared Palmer <[email protected]>", | ||
"repository": "formium/formik", | ||
|
@@ -38,25 +38,21 @@ | |
"lodash": "^4.17.14", | ||
"lodash-es": "^4.17.14", | ||
"react-fast-compare": "^2.0.1", | ||
"scheduler": "^0.18.0", | ||
"scheduler": "^0.20.1", | ||
"tiny-warning": "^1.0.2", | ||
"tslib": "^1.10.0" | ||
}, | ||
"resolutions": { | ||
"@types/react": "16.9.17", | ||
"@types/react-dom": "16.9.4" | ||
}, | ||
"devDependencies": { | ||
"@testing-library/react": "^11.0.4", | ||
"@testing-library/react": "^11.1.0", | ||
"@types/hoist-non-react-statics": "^3.3.1", | ||
"@types/lodash": "^4.14.119", | ||
"@types/react": "^16.9.17", | ||
"@types/react-dom": "^16.9.4", | ||
"@types/react": "^16.9.55", | ||
"@types/react-dom": "^16.9.9", | ||
"@types/warning": "^3.0.0", | ||
"@types/yup": "^0.24.9", | ||
"just-debounce-it": "^1.1.0", | ||
"react": "^16.12.0", | ||
"react-dom": "^16.12.0", | ||
"react": "^17.0.1", | ||
"react-dom": "^17.0.1", | ||
"yup": "^0.28.1" | ||
}, | ||
"jest": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.