Created
November 20, 2020 19:19
-
-
Save kino6052/bc3d4fbdf383a128edf4c2dd176932a5 to your computer and use it in GitHub Desktop.
Formik isPristine
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
const isPristine = ( | |
fieldName: string | string[], | |
touched: FormikTouched<FormikValues> | |
) => | |
[fieldName] | |
.flatMap((fieldName) => fieldName) | |
.every((fieldName) => !touched[fieldName]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment