Skip to content

Commit 90c2605

Browse files
dozoischFacebook Github Bot 2
authored andcommitted
Change TextInput prop check to print instead of throw
Summary: Follow up of facebook#8499! Open to discussion Motivation: See facebook#8499 (comment) Goal is to have the same failure mode in dev and prod. /cc ide Closes facebook#8757 Differential Revision: D3558991 fbshipit-source-id: c7d133f958e67ab23da486b1ffcb8f9963509b79
1 parent e8a388a commit 90c2605

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Libraries/Components/TextInput/TextInput.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const TimerMixin = require('react-timer-mixin');
2727
const TouchableWithoutFeedback = require('TouchableWithoutFeedback');
2828
const UIManager = require('UIManager');
2929
const View = require('View');
30+
const warning = require('fbjs/lib/warning');
3031

3132
const emptyFunction = require('fbjs/lib/emptyFunction');
3233
const invariant = require('fbjs/lib/invariant');
@@ -550,9 +551,10 @@ const TextInput = React.createClass({
550551
if (__DEV__) {
551552
for (var propKey in onlyMultiline) {
552553
if (props[propKey]) {
553-
throw new Error(
554+
const error = new Error(
554555
'TextInput prop `' + propKey + '` is only supported with multiline.'
555556
);
557+
warning(false, '%s', error.stack);
556558
}
557559
}
558560
}

0 commit comments

Comments
 (0)