-
Notifications
You must be signed in to change notification settings - Fork 358
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
checkPropTypes: add flag to throw the error instead of logging
Adds a `checkPropTypeWithErrors` convenience function, which calls `checkPropTypes` with `throwErrors` set to true Fixes #34
- Loading branch information
1 parent
f2cf875
commit 4ad04bf
Showing
5 changed files
with
45 additions
and
2 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
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
'use strict'; | ||
|
||
if (process.env.NODE_ENV !== 'production') { | ||
var checkPropTypes = require('./checkPropTypes'); | ||
} | ||
|
||
function checkPropTypesWithErrors(typeSpecs, values, location, componentName, getStack) { | ||
checkPropTypes(typeSpecs, values, location, componentName, getStack, true); | ||
} | ||
|
||
module.exports = checkPropTypesWithErrors; |
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