Skip to content

Commit 5bf8dfe

Browse files
committed
Should return Errors, not throw them, from PropTypes
1 parent 541d6e9 commit 5bf8dfe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/utils/shims.es6

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ export function int(a: string): number {
2020

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

0 commit comments

Comments
 (0)