Skip to content

Commit

Permalink
Should return Errors, not throw them, from PropTypes
Browse files Browse the repository at this point in the history
  • Loading branch information
STRML committed Apr 11, 2016
1 parent 541d6e9 commit 5bf8dfe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/utils/shims.es6
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ export function int(a: string): number {

export function dontSetMe(props: Object, propName: string, componentName: string) {
if (props[propName]) {
throw new Error(`Invalid prop ${propName} passed to ${componentName} - do not set this, set it on the child.`);
return new Error(`Invalid prop ${propName} passed to ${componentName} - do not set this, set it on the child.`);
}
}

0 comments on commit 5bf8dfe

Please sign in to comment.