Change TextInput prop check to print instead of throw

Summary:
Follow up of https://github.com/facebook/react-native/pull/8499! Open to discussion

Motivation:

See https://github.com/facebook/react-native/pull/8499#issuecomment-230004068

Goal is to have the same failure mode in dev and prod.

/cc ide
Closes https://github.com/facebook/react-native/pull/8757

Differential Revision: D3558991

fbshipit-source-id: c7d133f958e67ab23da486b1ffcb8f9963509b79
This commit is contained in:
Hugo Dozois 2016-07-13 16:33:39 -07:00 committed by Facebook Github Bot 2
parent e8a388a60a
commit 90c2605950

View File

@ -27,6 +27,7 @@ const TimerMixin = require('react-timer-mixin');
const TouchableWithoutFeedback = require('TouchableWithoutFeedback');
const UIManager = require('UIManager');
const View = require('View');
const warning = require('fbjs/lib/warning');
const emptyFunction = require('fbjs/lib/emptyFunction');
const invariant = require('fbjs/lib/invariant');
@ -550,9 +551,10 @@ const TextInput = React.createClass({
if (__DEV__) {
for (var propKey in onlyMultiline) {
if (props[propKey]) {
throw new Error(
const error = new Error(
'TextInput prop `' + propKey + '` is only supported with multiline.'
);
warning(false, '%s', error.stack);
}
}
}