mirror of
https://github.com/status-im/react-native.git
synced 2025-01-14 19:44:13 +00:00
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:
parent
33d59137a5
commit
508cc06565
@ -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 =
|
||||
|
Loading…
x
Reference in New Issue
Block a user