Fix autoFocus

Summary: In D13408886, I landed a PR that broke the `autoFocus` prop. This diff fixes this prop by partially reveting some of the changes in that diff.

Reviewed By: TheSavior

Differential Revision: D13611258

fbshipit-source-id: 225b9b59b2500cfac092f13c273685aaeb599ab0
This commit is contained in:
Ramanpreet Nara 2019-01-09 15:19:16 -08:00 committed by Facebook Github Bot
parent f40a04ae3a
commit 0265ee199b

View File

@ -891,6 +891,10 @@ const TextInput = createReactClass({
// tag is null only in unit tests
TextInputState.registerInput(tag);
}
if (this.props.autoFocus) {
this._rafId = requestAnimationFrame(this.focus);
}
},
componentWillUnmount: function() {