Fix TextInput autocorrect (#7496)
Fix TextInput autocorrect (#7496)

Summary:
Autocorrect was broken for controlled TextInput components by a change to batch event handling in React Native:
https://github.com/facebook/react/commit/9f11f8c2634921e657df2691e6bfda18fead5bcc

For example, a TextInput like this would be affected by this bug:

```javascript
<TextInput
  autoCorrect={true}
  style={{height: 26, width: 100}}
  onChangeText={(text) => this.setState({ text })}
  value={this.state.text}
/>
```
This fix uses the same approach as
https://github.com/facebook/react-native/commit/0cd2904b235f53ed684bb9898280461e2cee0b5b

The problem is that TextInput's _onChange handler relied on this.props.value being updated synchronously when calling this.props.onChangeText(text). However, this assumption was broken when React Native event handling started being batched.

The fix is to move the code that relies on this.props.value being up-to-date to componentDidUpdate.

**Test plan (required)**

Tested autocorrect now works on iOS in a small app and a large app. Also tested t
Closes https://github.com/facebook/react-native/pull/7676

Differential Revision: D3346221

Pulled By: nicklockwood

fbshipit-source-id: 715df3e8a03aa58cb0a462de4add02289d42782f

aaron-goshine/react-native,chnfeeeeeef/react-native,Ehesp/react-native,jevakallio/react-native,shrutic123/react-native,DannyvanderJagt/react-native,esauter5/react-native,nickhudkins/react-native,skevy/react-native,kesha-antonov/react-native,makadaw/react-native,lprhodes/react-native,rickbeerendonk/react-native,hoangpham95/react-native,salanki/react-native,cosmith/react-native,hammerandchisel/react-native,exponentjs/react-native,tarkus/react-native-appletv,frantic/react-native,happypancake/react-native,jhen0409/react-native,naoufal/react-native,gilesvangruisen/react-native,hoastoolshop/react-native,Swaagie/react-native,corbt/react-native,Purii/react-native,mrspeaker/react-native,eduardinni/react-native,cpunion/react-native,farazs/react-native,hoangpham95/react-native,Ehesp/react-native,eduardinni/react-native,Emilios1995/react-native,satya164/react-native,Andreyco/react-native,skevy/react-native,jhen0409/react-native,catalinmiron/react-native,chnfeeeeeef/react-native,imDangerous/react-native,nathanajah/react-native,chnfeeeeeef/react-native,browniefed/react-native,htc2u/react-native,htc2u/react-native,Emilios1995/react-native,shrutic/react-native,xiayz/react-native,jhen0409/react-native,Maxwell2022/react-native,gilesvangruisen/react-native,makadaw/react-native,ankitsinghania94/react-native,foghina/react-native,happypancake/react-native,shrutic123/react-native,ndejesus1227/react-native,Andreyco/react-native,jadbox/react-native,jadbox/react-native,clozr/react-native,eduardinni/react-native,frantic/react-native,Bhullnatik/react-native,tarkus/react-native-appletv,csatf/react-native,jaggs6/react-native,PlexChat/react-native,tarkus/react-native-appletv,mironiasty/react-native,eduardinni/react-native,hoastoolshop/react-native,jasonnoahchoi/react-native,facebook/react-native,jasonnoahchoi/react-native,brentvatne/react-native,negativetwelve/react-native,facebook/react-native,tadeuzagallo/react-native,xiayz/react-native,esauter5/react-native,Bhullnatik/react-native,kesha-antonov/react-native,makadaw/react-native,salanki/react-native,CodeLinkIO/react-native,imDangerous/react-native,esauter5/react-native,jaggs6/react-native,aljs/react-native,skatpgusskat/react-native,gre/react-native,PlexChat/react-native,mironiasty/react-native,luqin/react-native,makadaw/react-native,cdlewis/react-native,Bhullnatik/react-native,tgoldenberg/react-native,Livyli/react-native,ptmt/react-native-macos,chnfeeeeeef/react-native,skatpgusskat/react-native,Swaagie/react-native,callstack-io/react-native,hoangpham95/react-native,satya164/react-native,tgoldenberg/react-native,wenpkpk/react-native,htc2u/react-native,Maxwell2022/react-native,Andreyco/react-native,alin23/react-native,makadaw/react-native,happypancake/react-native,ptomasroos/react-native,imDangerous/react-native,catalinmiron/react-native,shrutic123/react-native,tsjing/react-native,christopherdro/react-native,farazs/react-native,chnfeeeeeef/react-native,exponentjs/react-native,browniefed/react-native,cdlewis/react-native,charlesvinette/react-native,nickhudkins/react-native,myntra/react-native,tszajna0/react-native,tgoldenberg/react-native,doochik/react-native,cpunion/react-native,javache/react-native,nickhudkins/react-native,CodeLinkIO/react-native,facebook/react-native,imDangerous/react-native,formatlos/react-native,jevakallio/react-native,csatf/react-native,rickbeerendonk/react-native,orenklein/react-native,forcedotcom/react-native,Andreyco/react-native,thotegowda/react-native,ndejesus1227/react-native,csatf/react-native,jaggs6/react-native,xiayz/react-native,htc2u/react-native,wenpkpk/react-native,tadeuzagallo/react-native,hammerandchisel/react-native,CodeLinkIO/react-native,jevakallio/react-native,rickbeerendonk/react-native,ptmt/react-native-macos,Livyli/react-native,formatlos/react-native,csatf/react-native,Bhullnatik/react-native,luqin/react-native,aaron-goshine/react-native,tszajna0/react-native,cosmith/react-native,Andreyco/react-native,hoangpham95/react-native,tsjing/react-native,skevy/react-native,Guardiannw/react-native,Guardiannw/react-native,exponentjs/react-native,cosmith/react-native,nickhudkins/react-native,myntra/react-native,nickhudkins/react-native,naoufal/react-native,catalinmiron/react-native,clozr/react-native,Livyli/react-native,imjerrybao/react-native,ndejesus1227/react-native,aljs/react-native,clozr/react-native,corbt/react-native,cpunion/react-native,adamjmcgrath/react-native,foghina/react-native,salanki/react-native,CodeLinkIO/react-native,janicduplessis/react-native,hoangpham95/react-native,cdlewis/react-native,aljs/react-native,luqin/react-native,Andreyco/react-native,mrspeaker/react-native,callstack-io/react-native,thotegowda/react-native,exponent/react-native,thotegowda/react-native,imDangerous/react-native,aljs/react-native,brentvatne/react-native,nathanajah/react-native,facebook/react-native,csatf/react-native,eduardinni/react-native,satya164/react-native,luqin/react-native,cdlewis/react-native,xiayz/react-native,farazs/react-native,Swaagie/react-native,peterp/react-native,tsjing/react-native,kesha-antonov/react-native,tsjing/react-native,cdlewis/react-native,aaron-goshine/react-native,Maxwell2022/react-native,imjerrybao/react-native,aaron-goshine/react-native,DanielMSchmidt/react-native,arthuralee/react-native,jevakallio/react-native,negativetwelve/react-native,Purii/react-native,peterp/react-native,tszajna0/react-native,shrutic/react-native,lprhodes/react-native,Livyli/react-native,doochik/react-native,cpunion/react-native,tgoldenberg/react-native,tarkus/react-native-appletv,satya164/react-native,mironiasty/react-native,janicduplessis/react-native,shrutic123/react-native,mironiasty/react-native,formatlos/react-native,tarkus/react-native-appletv,charlesvinette/react-native,farazs/react-native,tadeuzagallo/react-native,callstack-io/react-native,gre/react-native,tszajna0/react-native,DannyvanderJagt/react-native,htc2u/react-native,brentvatne/react-native,Ehesp/react-native,alin23/react-native,CodeLinkIO/react-native,charlesvinette/react-native,orenklein/react-native,browniefed/react-native,myntra/react-native,Purii/react-native,DanielMSchmidt/react-native,gilesvangruisen/react-native,eduardinni/react-native,Purii/react-native,ankitsinghania94/react-native,hammerandchisel/react-native,forcedotcom/react-native,tszajna0/react-native,tsjing/react-native,Bhullnatik/react-native,catalinmiron/react-native,doochik/react-native,kesha-antonov/react-native,cosmith/react-native,wenpkpk/react-native,javache/react-native,aaron-goshine/react-native,jadbox/react-native,tszajna0/react-native,negativetwelve/react-native,esauter5/react-native,pandiaraj44/react-native,salanki/react-native,skevy/react-native,frantic/react-native,naoufal/react-native,callstack-io/react-native,peterp/react-native,CodeLinkIO/react-native,tsjing/react-native,thotegowda/react-native,janicduplessis/react-native,thotegowda/react-native,hammerandchisel/react-native,imjerrybao/react-native,aaron-goshine/react-native,nickhudkins/react-native,ankitsinghania94/react-native,mironiasty/react-native,happypancake/react-native,arthuralee/react-native,htc2u/react-native,nathanajah/react-native,esauter5/react-native,Livyli/react-native,brentvatne/react-native,rickbeerendonk/react-native,pandiaraj44/react-native,javache/react-native,Swaagie/react-native,tadeuzagallo/react-native,wenpkpk/react-native,ankitsinghania94/react-native,negativetwelve/react-native,callstack-io/react-native,Maxwell2022/react-native,tgoldenberg/react-native,negativetwelve/react-native,gilesvangruisen/react-native,jhen0409/react-native,skevy/react-native,facebook/react-native,jaggs6/react-native,gilesvangruisen/react-native,mironiasty/react-native,satya164/react-native,csatf/react-native,Bhullnatik/react-native,DanielMSchmidt/react-native,shrutic/react-native,pandiaraj44/react-native,skatpgusskat/react-native,alin23/react-native,facebook/react-native,janicduplessis/react-native,Andreyco/react-native,forcedotcom/react-native,cosmith/react-native,cdlewis/react-native,corbt/react-native,negativetwelve/react-native,orenklein/react-native,InterfaceInc/react-native,javache/react-native,InterfaceInc/react-native,Purii/react-native,nickhudkins/react-native,InterfaceInc/react-native,peterp/react-native,adamjmcgrath/react-native,arthuralee/react-native,chnfeeeeeef/react-native,browniefed/react-native,salanki/react-native,shrutic123/react-native,pandiaraj44/react-native,imDangerous/react-native,shrutic/react-native,clozr/react-native,gitim/react-native,tszajna0/react-native,janicduplessis/react-native,naoufal/react-native,mrspeaker/react-native,javache/react-native,shrutic/react-native,alin23/react-native,Emilios1995/react-native,kesha-antonov/react-native,browniefed/react-native,dikaiosune/react-native,DanielMSchmidt/react-native,hoastoolshop/react-native,shrutic123/react-native,PlexChat/react-native,adamjmcgrath/react-native,formatlos/react-native,callstack-io/react-native,ptmt/react-native-macos,adamjmcgrath/react-native,ptomasroos/react-native,jadbox/react-native,ndejesus1227/react-native,adamjmcgrath/react-native,imjerrybao/react-native,kesha-antonov/react-native,tarkus/react-native-appletv,imjerrybao/react-native,formatlos/react-native,Guardiannw/react-native,thotegowda/react-native,christopherdro/react-native,ptomasroos/react-native,eduardinni/react-native,jevakallio/react-native,frantic/react-native,corbt/react-native,shrutic/react-native,brentvatne/react-native,corbt/react-native,hoastoolshop/react-native,skatpgusskat/react-native,javache/react-native,shrutic/react-native,gre/react-native,doochik/react-native,farazs/react-native,cdlewis/react-native,nathanajah/react-native,jadbox/react-native,hoangpham95/react-native,nickhudkins/react-native,kesha-antonov/react-native,naoufal/react-native,cpunion/react-native,happypancake/react-native,PlexChat/react-native,nathanajah/react-native,Guardiannw/react-native,adamjmcgrath/react-native,ptmt/react-native-macos,myntra/react-native,farazs/react-native,tgoldenberg/react-native,corbt/react-native,arthuralee/react-native,catalinmiron/react-native,hoastoolshop/react-native,Swaagie/react-native,cosmith/react-native,dikaiosune/react-native,cpunion/react-native,clozr/react-native,forcedotcom/react-native,brentvatne/react-native,orenklein/react-native,lprhodes/react-native,callstack-io/react-native,mironiasty/react-native,Swaagie/react-native,Purii/react-native,dikaiosune/react-native,gitim/react-native,imjerrybao/react-native,jasonnoahchoi/react-native,esauter5/react-native,Maxwell2022/react-native,xiayz/react-native,myntra/react-native,kesha-antonov/react-native,satya164/react-native,exponent/react-native,browniefed/react-native,ankitsinghania94/react-native,formatlos/react-native,gre/react-native,makadaw/react-native,Guardiannw/react-native,cosmith/react-native,jaggs6/react-native,myntra/react-native,negativetwelve/react-native,facebook/react-native,brentvatne/react-native,DannyvanderJagt/react-native,Emilios1995/react-native,jhen0409/react-native,gitim/react-native,tadeuzagallo/react-native,charlesvinette/react-native,formatlos/react-native,janicduplessis/react-native,shrutic123/react-native,csatf/react-native,doochik/react-native,jasonnoahchoi/react-native,cdlewis/react-native,ankitsinghania94/react-native,dikaiosune/react-native,gitim/react-native,Andreyco/react-native,clozr/react-native,jaggs6/react-native,jadbox/react-native,alin23/react-native,mrspeaker/react-native,tarkus/react-native-appletv,Emilios1995/react-native,nathanajah/react-native,ptomasroos/react-native,forcedotcom/react-native,formatlos/react-native,hoastoolshop/react-native,wenpkpk/react-native,pandiaraj44/react-native,myntra/react-native,Purii/react-native,brentvatne/react-native,DanielMSchmidt/react-native,ndejesus1227/react-native,foghina/react-native,luqin/react-native,thotegowda/react-native,ndejesus1227/react-native,jevakallio/react-native,salanki/react-native,jhen0409/react-native,exponentjs/react-native,jevakallio/react-native,callstack-io/react-native,gre/react-native,DanielMSchmidt/react-native,gitim/react-native,InterfaceInc/react-native,Guardiannw/react-native,CodeLinkIO/react-native,facebook/react-native,makadaw/react-native,Swaagie/react-native,gilesvangruisen/react-native,jhen0409/react-native,skevy/react-native,Livyli/react-native,Ehesp/react-native,happypancake/react-native,shrutic123/react-native,exponentjs/react-native,gre/react-native,skevy/react-native,peterp/react-native,aaron-goshine/react-native,alin23/react-native,browniefed/react-native,javache/react-native,skatpgusskat/react-native,foghina/react-native,ptmt/react-native-macos,salanki/react-native,xiayz/react-native,orenklein/react-native,wenpkpk/react-native,dikaiosune/react-native,ndejesus1227/react-native,gitim/react-native,christopherdro/react-native,forcedotcom/react-native,imjerrybao/react-native,jasonnoahchoi/react-native,clozr/react-native,htc2u/react-native,forcedotcom/react-native,hammerandchisel/react-native,makadaw/react-native,DannyvanderJagt/react-native,frantic/react-native,farazs/react-native,lprhodes/react-native,Purii/react-native,exponentjs/react-native,tadeuzagallo/react-native,jaggs6/react-native,dikaiosune/react-native,exponent/react-native,PlexChat/react-native,hammerandchisel/react-native,jaggs6/react-native,aljs/react-native,makadaw/react-native,pandiaraj44/react-native,catalinmiron/react-native,ptomasroos/react-native,Livyli/react-native,ndejesus1227/react-native,jevakallio/react-native,naoufal/react-native,skatpgusskat/react-native,Emilios1995/react-native,jevakallio/react-native,exponent/react-native,doochik/react-native,exponent/react-native,doochik/react-native,cdlewis/react-native,christopherdro/react-native,lprhodes/react-native,exponentjs/react-native,mironiasty/react-native,arthuralee/react-native,PlexChat/react-native,DanielMSchmidt/react-native,Bhullnatik/react-native,tsjing/react-native,orenklein/react-native,eduardinni/react-native,xiayz/react-native,facebook/react-native,christopherdro/react-native,javache/react-native,christopherdro/react-native,exponent/react-native,esauter5/react-native,dikaiosune/react-native,ptomasroos/react-native,pandiaraj44/react-native,imDangerous/react-native,charlesvinette/react-native,doochik/react-native,peterp/react-native,foghina/react-native,adamjmcgrath/react-native,skatpgusskat/react-native,mrspeaker/react-native,DannyvanderJagt/react-native,gre/react-native,chnfeeeeeef/react-native,alin23/react-native,happypancake/react-native,dikaiosune/react-native,christopherdro/react-native,happypancake/react-native,csatf/react-native,brentvatne/react-native,cpunion/react-native,PlexChat/react-native,hoangpham95/react-native,gilesvangruisen/react-native,CodeLinkIO/react-native,ptmt/react-native-macos,Ehesp/react-native,mrspeaker/react-native,Maxwell2022/react-native,jasonnoahchoi/react-native,InterfaceInc/react-native,satya164/react-native,InterfaceInc/react-native,Emilios1995/react-native,peterp/react-native,luqin/react-native,janicduplessis/react-native,foghina/react-native,hoastoolshop/react-native,lprhodes/react-native,tarkus/react-native-appletv,tszajna0/react-native,Bhullnatik/react-native,skevy/react-native,orenklein/react-native,ankitsinghania94/react-native,InterfaceInc/react-native,mrspeaker/react-native,rickbeerendonk/react-native,hoangpham95/react-native,Guardiannw/react-native,foghina/react-native,corbt/react-native,rickbeerendonk/react-native,wenpkpk/react-native,negativetwelve/react-native,christopherdro/react-native,luqin/react-native,aljs/react-native,wenpkpk/react-native,Maxwell2022/react-native,salanki/react-native,gitim/react-native,satya164/react-native,lprhodes/react-native,Ehesp/react-native,tadeuzagallo/react-native,hoastoolshop/react-native,pandiaraj44/react-native,nathanajah/react-native,alin23/react-native,lprhodes/react-native,rickbeerendonk/react-native,nathanajah/react-native,browniefed/react-native,jadbox/react-native,janicduplessis/react-native,PlexChat/react-native,ptomasroos/react-native,tgoldenberg/react-native,javache/react-native,DannyvanderJagt/react-native,naoufal/react-native,gilesvangruisen/react-native,imDangerous/react-native,aaron-goshine/react-native,aljs/react-native,InterfaceInc/react-native,catalinmiron/react-native,cpunion/react-native,jasonnoahchoi/react-native,exponent/react-native,tgoldenberg/react-native,rickbeerendonk/react-native,Ehesp/react-native,farazs/react-native,mironiasty/react-native,esauter5/react-native,chnfeeeeeef/react-native,jadbox/react-native,exponentjs/react-native,ptomasroos/react-native,corbt/react-native,imjerrybao/react-native,ankitsinghania94/react-native,naoufal/react-native,kesha-antonov/react-native,skatpgusskat/react-native,Guardiannw/react-native,DannyvanderJagt/react-native,peterp/react-native,gitim/react-native,doochik/react-native,aljs/react-native,jhen0409/react-native,charlesvinette/react-native,myntra/react-native,hammerandchisel/react-native,cosmith/react-native,gre/react-native,ptmt/react-native-macos,tsjing/react-native,jasonnoahchoi/react-native,rickbeerendonk/react-native,DanielMSchmidt/react-native,myntra/react-native,orenklein/react-native,thotegowda/react-native,charlesvinette/react-native,clozr/react-native,tadeuzagallo/react-native,adamjmcgrath/react-native,Ehesp/react-native,Maxwell2022/react-native,farazs/react-native,Swaagie/react-native,htc2u/react-native,charlesvinette/react-native,DannyvanderJagt/react-native,formatlos/react-native,xiayz/react-native,catalinmiron/react-native,Livyli/react-native,ptmt/react-native-macos,foghina/react-native,negativetwelve/react-native,exponent/react-native,shrutic/react-native,forcedotcom/react-native,mrspeaker/react-native,hammerandchisel/react-native,luqin/react-native,Emilios1995/react-native