Add __DEV__ around textInput prop check

Summary:
**Motivation**

The prop validation was run on every render, even in prod which seems odd to me. This adds a dev check to make sure prod build skips the validation.

**Test plan (required)**

There are no changes to the ui.
Closes https://github.com/facebook/react-native/pull/8499

Differential Revision: D3508805

Pulled By: javache

fbshipit-source-id: 68c6a1224e33997f9df93481426daff790ef5bcd
This commit is contained in:
Hugo Dozois 2016-07-01 04:08:22 -07:00 committed by Facebook Github Bot 8
parent 33d59137a5
commit 508cc06565

View File

@ -538,11 +538,13 @@ const TextInput = React.createClass({
var props = Object.assign({}, this.props);
props.style = [styles.input, this.props.style];
if (!props.multiline) {
for (var propKey in onlyMultiline) {
if (props[propKey]) {
throw new Error(
'TextInput prop `' + propKey + '` is only supported with multiline.'
);
if (__DEV__) {
for (var propKey in onlyMultiline) {
if (props[propKey]) {
throw new Error(
'TextInput prop `' + propKey + '` is only supported with multiline.'
);
}
}
}
textContainer =