From 90c26059500db413d9edabbace02cb0b0819b258 Mon Sep 17 00:00:00 2001 From: Hugo Dozois Date: Wed, 13 Jul 2016 16:33:39 -0700 Subject: [PATCH] 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 --- Libraries/Components/TextInput/TextInput.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Libraries/Components/TextInput/TextInput.js b/Libraries/Components/TextInput/TextInput.js index c950b4291..8a08381e9 100644 --- a/Libraries/Components/TextInput/TextInput.js +++ b/Libraries/Components/TextInput/TextInput.js @@ -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); } } }