mirror of
https://github.com/status-im/react-native.git
synced 2025-01-14 19:44:13 +00:00
_getText defaults to blank string when no default value set
Summary: One of the potential fixes that grabbou suggested was to make _getText return an empty string in the worst case of null value and null defaultValue. Closes https://github.com/facebook/react-native/pull/9553 Differential Revision: D3800913 fbshipit-source-id: 30d9c0a7384d39477a71947714eec3340ba5380f
This commit is contained in:
parent
c0de1a7011
commit
61832b4323
@ -575,7 +575,11 @@ const TextInput = React.createClass({
|
||||
_getText: function(): ?string {
|
||||
return typeof this.props.value === 'string' ?
|
||||
this.props.value :
|
||||
this.props.defaultValue;
|
||||
(
|
||||
typeof this.props.defaultValue === 'string' ?
|
||||
this.props.defaultValue :
|
||||
''
|
||||
);
|
||||
},
|
||||
|
||||
_setNativeRef: function(ref: any) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user