Fix app crash caused by TextInput.
Reviewed By: zjj010104 Differential Revision: D2761644 fb-gh-sync-id: 89241de2f8c84d569ec452871f740a0d655cc95e
This commit is contained in:
parent
4e2a31685c
commit
53d18c83c8
|
@ -550,6 +550,12 @@ var TextInput = React.createClass({
|
|||
this.props.onChange && this.props.onChange(event);
|
||||
this.props.onChangeText && this.props.onChangeText(text);
|
||||
|
||||
if (!this.refs.input) {
|
||||
// calling `this.props.onChange` or `this.props.onChangeText`
|
||||
// may clean up the input itself. Exits here.
|
||||
return;
|
||||
}
|
||||
|
||||
// This is necessary in case native updates the text and JS decides
|
||||
// that the update should be ignored and we should stick with the value
|
||||
// that we have in JS.
|
||||
|
|
Loading…
Reference in New Issue