Last active
August 4, 2017 16:13
-
-
Save amankkg/b4bef84701f37208f8c5cede9d85832f to your computer and use it in GitHub Desktop.
no-complex-logic-in-prop-types.js
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 withErrors = shape({ hasErrors: oneOf([true]).isRequired, errors: arrayOf(string).isRequired }) | |
const withoutErrors = shape({ hasErrors: oneOf([false]).isRequired, errors: arrayOf(string) }) | |
const result = oneOfType([withErrors, withoutErrors]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment