Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement onKeyPress Android #14720

Conversation

joshjhargreaves
Copy link
Contributor

@joshjhargreaves joshjhargreaves commented Jun 25, 2017

Motivation

This implements onKeyPress for Android on TextInputs and addresses #1882.
N.B. that this PR has not yet addressed hardware keyboard inputs, but doing will be fairly trivial. The main challenge was doing this for soft keyboard inputs.

I've tried to match the style as much as I could. Will happily make any suggested edits be they architectural or stylistic design (edit: and of course implementation), but hopefully this is a good first pass :).
I think important to test this on the most popular keyboard types; maybe different languages too.
I have not yet added tests to test implementation, but will be happy to do that also.

Test Plan

  • Build & run RNTester project for Android and open TextInput.
  • Enter keys into 'event handling' TextInput.
  • Verify that keys you enter appear in onKeyPress below the text input
  • Test with autocorrect off, on same input and validate that results are the same.

Below is a gif of PR in action.
onkeypressandroid

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. GH Review: review-needed labels Jun 25, 2017
Copy link
Contributor

@shergin shergin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!
I think it is a highly requested and useful feature which unlikely can be implemented perfectly right at the first attempt. So, we probably should fix all currently known issues (with Swift Keyboard) and then polish this down the road.

@achen1 What do you think?

private final InternalKeyListener mKeyListener;
private boolean mDetectScrollMovement = false;

private ReactViewBackgroundDrawable mReactBackgroundDrawable;

private static final KeyListener sKeyListener = QwertyKeyListener.getInstanceForFullKeyboard();

public ReactEditText(Context context) {
public ReactEditText(Context context, InputConnectionWrapper inputConnection) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am totally n00b in Android, but maybe we should call it inputConnectionWrapper instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'totally n00b in Android': that makes two of us then ;). Thank-you yes, good point!

* input, and then set the composing text to be the character the user entered. In this case we
* choose our onKeyPress to be the new composing character.
*/
class ReactTextInputInputConnection extends InputConnectionWrapper {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

space character before class ...

@joshjhargreaves
Copy link
Contributor Author

joshjhargreaves commented Jun 26, 2017

@shergin, thank-you for taking a look at this, very much appreciated :).

I actually have only just seem this ticket on the `Better <TextInput>' board, already triaged. They have taken the approach of detecting the key by changes to the text itself, just like the iOS implementation. This was the first route I went down, but found that TextWatching really didn't give you much in the way of helping you distinguish between different types of input, be they autocorrection's, cut/paste etc. Although it's hard to say at this point if key detection as done in this PR is too hard/a good idea with the potential wide variety of behavior from different IMEs.

I will say, you do at least need to use the InputConnection override for detecting the 'empty delete' case I mentioned, for detecting deletes which result in no text changes. Maybe even this could be used in combination with a TextWatcher, to reason about if text changes were results of changes from the soft keyboard.

I do think this is a really fiddly problem, and I'd say that this implementation handles pretty much every case (with stock Android keyboard). But perhaps we've ended up with a solution that's overfitted, and we'll have to go more generic solution.

@joshjhargreaves
Copy link
Contributor Author

joshjhargreaves commented Jun 26, 2017

status update
I think it can be quite easy to get bogged down in implementation details sometimes, instead of thinking bigger picture!

So I think it's worth asking, 'what is the real value add' with implementing onKeyPress on Android for users? The thing that users cannot currently do currently on RN Android is detect 'empty deletes' or distinguish between key presses and cut and/or pastes. This we can do natively, and this is what I think we should effectively expose through this API. We should support the same features as onKeyPress on iOS: 'Backspace' & 'Enter' & any other key press events should only be triggered by keyboard input and not cut/copy & we should support the empty delete case.

From further investigation with SwiftKey vs stock Android keyboard and what we cannot do natively is know what key was pressed to 'complete' a word from a word suggestion, thus we cannot infer the keyPress in this case; we do not get that level granularity. So given we cannot do this natively, (or at least very easily at all, see the distinct lack of stack overflow answers on the topic), IMO we should not worry about this use case; RN on iOS also has these same issues.

I'll update the issue tracking this feature with a link to think.

@PardeepK
Copy link

@joshyhargreaves , with this implementation, we won't get onKeyPress event for keys like up/down/left/right or hardware keyboard's ENTER key.
So why don't we use native Android control EditText.onKeyup() (or KeyListener.onKeyUp()) to propagate key event to JS? That way we will also get this event if user press non-printable keys like up/down/left/right arrow keys?

@PardeepK
Copy link

@joshyhargreaves also is there any timeline by when we will get this merged to master?

@joshjhargreaves
Copy link
Contributor Author

@PardeepK, onKeyUp events only work with hardware keyaboards as of ~Android 4.1, so not possible. We can of course still forward the events for hardware keyboards. This would be unlike the iOS inplementstion which works by watching the text.

I also think I’ve made too many assumptions about how different IMEs work based on the behaviour of the Android built in keyboard. For one, I don’t think you can assume beginBatchEdit is going to be called before any input events, and it’s up to the IME to call this, but not a requirement.

I have no timeline on when this will be merged; I think it needs to be integrated upon a few more times. Ultimately I think the behaviour RN users want but do not currently have is th ability to detect delete key presses on an empty text field, and perhaps this is the real value add of implementing this API and is what we should mainly be focussing upon as I don’t think this API is really possible to implement in the same way as the web.

@PardeepK
Copy link

Thanks @joshyhargreaves for quick reply!
I need onKeyPress event for h/w keyboard up/down arrow key. I was investigating and found that in vanilla (non-react) Android app, I get EditText::onKeyDown/onKeyUp() callback for all keys for both s/w and h/w keyboard. But when I am using react-native TextInput in Android app, I am not getting these onkeyDown() onKeyUp() methods invoked. any reason?
Also onKeyDown/onKeyUp() methods in InternalKeyListener (inner class in ReactEditText) are not getting invoked when user presses left/right/up/down key on h/w keyboard. I am not sure where these keyEvents are getting consumed. In fact I added these onKeyUp/onKeyDown methods in ReactRootView class, those also not getting invoked when I used h/w keyboard.

Appreciate any help!

@joshjhargreaves
Copy link
Contributor Author

Copied from stackoveflow answer: from http://developer.android.com/reference/android/view/KeyEvent.html

As soft input methods can use multiple and inventive ways of inputting text, there is no guarantee that any key press on a soft keyboard will generate a key event: this is left to the IME's discretion, and in fact sending such events is discouraged. You should never rely on receiving KeyEvents for any key on a soft input method. In particular, the default software keyboard will never send any key event to any application targetting Jelly Bean or later, and will only send events for some presses of the delete and return keys to applications targetting Ice Cream Sandwich or earlier. Be aware that other software input methods may never send key events regardless of the version. Consider using editor actions like IME_ACTION_DONE if you need specific interaction with the software keyboard, as it gives more visibility to the user as to how your application will react to key presses.

I have set up a vanilla project to test this and have observed that onKeyPress etc so perhaps the above is why you’re not seeing the events? I didn’t try arrow keys actually so they might still be sent by the IME and maybe that’s what you’re seeing? Hmm, not sure why you’d be seeing differences actually I haven’t observed different bevahour in the different cases. I have noticed subtle differences when autocorrect is on and off, so that might be worth checking.

No problem, I’d like to see this solved too!

@PardeepK
Copy link

@joshyhargreaves any recommendation/help how can we capture hardware keyboard key press for TextInput (ReactEditText) RN control on Android?

@facebook-github-bot
Copy link
Contributor

@joshyhargreaves I tried to find reviewers for this pull request and wanted to ping them to take another look. However, based on the blame information for the files in this pull request I couldn't find any reviewers. This sometimes happens when the files in the pull request are new or don't exist on master anymore. Is this pull request still relevant? If yes could you please rebase? In case you know who has context on this code feel free to mention them in a comment (one person is fine). Thanks for reading and hope you will continue contributing to the project.

@shergin
Copy link
Contributor

shergin commented Sep 14, 2017

@joshyhargreaves Are you personally satisfied with this?
Could you please resolve conflicts?

@joshjhargreaves
Copy link
Contributor Author

joshjhargreaves commented Sep 27, 2017

@shergin sorry I missed the email mention!

Yes I can fix up the PR, sorry this fell off my radar with a talk I was doing! But now I'm free to finish this up; thank you for the continued input, it'd be great to get this landed!

So @shergin, I'm not quite happy with this exact approach, it's a solution which is definitely overfit to the stock Android stock keyboard IME lifecycle events and could be a bit fragile with other keyboards as a result. I think the solution is to make the logic a bit more naive (and cover more keyboards) by using a TextWatcher implementation similar to the onKeyPress iOS implementation.

The key thing I think we should enable as part of this PR is backspace detection on an empty text-input, as that's something that users need. For example: jwohlfert23/react-native-tag-input#31. Would you agree?

So I think I'll aim for a combined approach of what I have here for backspace on empty text-input detection, along with simplified text-watcher logic.

@joshjhargreaves
Copy link
Contributor Author

@shergin, it looks like the logic of can be a lot simpler by using TextWatcher; but using an the InputConnection to catch the ‘empty deletes’. Hopefully this should be fairly trivial, but looking into detecting when a text input update came from a cut/paste, but fingers crossed that should be easy enough

@joshjhargreaves
Copy link
Contributor Author

Looking to update this PR after the weekend, will keep everyone posted.

@joshjhargreaves
Copy link
Contributor Author

joshjhargreaves commented Oct 4, 2017

@shergin I implemented the logic using the TextWatcher API and I am happy with the resultant functionality! I haven't updated this PR, as I may swing back to fixing up the original method given now I have a greater understand of the finer details of the implementation: https://github.com/facebook/react-native/compare/master...joshyhargreaves:implement_edittext_onkeypress_android_textwatcher_rework?diff=unified&name=implement_edittext_onkeypress_android_textwatcher_rework

Functionality wise, it seems to work as I'd expect with both SwiftKey and stock Android keyboard :). However it turns out that the logic needed to be a bit more hacky (as you can probably see) to implement the API. We know less about how the input was changed with the TextWatcher approach, so we need to have some additional state around whether it was a cut/paste which changed the input, for example.

Regardless of this, I'm positive that with a bit more refinement & testing, we will have something soon that should be good enough to use!

@joshjhargreaves
Copy link
Contributor Author

@shergin I revised the methodology with the original implementation; code is a lot cleaner than the alternate TextWatcher approach I linked above.

I have tested on SwiftKey and stock Android keyboard, and it seems to work well :).
keypress_demo

@joshjhargreaves
Copy link
Contributor Author

@lako90, would you also mind having a look?

@DarrylD
Copy link

DarrylD commented Dec 11, 2017

Any movement on this?

@joshjhargreaves
Copy link
Contributor Author

@DarrylD I'm happy to whatever needs to be done to get this merged. @shergin @hramos could you provide some guidance on this?

Copy link
Contributor

@kmagiera kmagiera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff @joshyhargreaves

I've put some minor comments here and there. I hope that my comments will help improve this PR and get it merged sooner.

@@ -88,7 +88,9 @@ public String getName() {

@Override
public ReactEditText createViewInstance(ThemedReactContext context) {
ReactEditText editText = new ReactEditText(context);
ReactTextInputInputConnection inputConnection = new ReactTextInputInputConnection(null, true, context);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic of instantiating InputConnection seems overly complicated. If you don't need to keep a reference to inputConnection outside of ReactEditText class why not instantiate it directly in ReactEditText#onCreateInputConnection ? This will make setEditText and setTarget methods no longer needed and result in a cleaner contract for ReactTextInputInputConnection.

a) setEditText will not be necessary if you are instantiating it from onCreateInputConnection because you can have the reference to ReactEditText there, just use this.
b) setTarget can be replaced by just passing InputConnection we want to wrap directly via constructor of ReactTextInputInputConnection

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, very good point!

import com.facebook.react.uimanager.UIManagerModule;
import com.facebook.react.uimanager.events.EventDispatcher;

class ReactTextInputInputConnection extends InputConnectionWrapper {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to have some high level comment here on what this class is for.

Also I think you didn't want to name this class this way ("InputInput"). As you need to change the name anyways I suggest that the class name include the word "Wrapper" (e.g. "ReactEditTextInputConnectionWrapper")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like a more sensible name, thank you :P.

import com.facebook.react.uimanager.events.EventDispatcher;

class ReactTextInputInputConnection extends InputConnectionWrapper {
public static final String NewLineRawValue = "\n";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public static final fields should be all caps with underscores: NEW_LINE_RAW_VALUE etc

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

public static final String BackspaceKeyValue = "Backspace";
public static final String EnterKeyValue = "Enter";

private @Nullable ReactEditText mEditText;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you use @Nullable annotation you should make sure to do null checks before calling methods on that object or use assertNoNull. Although as per my other comment about removing setEditText I think if you follow that comment you won't need @Nullable here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, with your suggested changes, @Nullable no longer necessary!

@joshjhargreaves
Copy link
Contributor Author

@kmagiera made the changes you suggested, let me know what you think.

Copy link
Contributor

@kmagiera kmagiera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just few more minor comments I missed last time. Otherwise this looks good!

final ReactContext reactContext,
final ReactEditText editText
) {
super(target, mutable);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we are no longer updating target we can just default to mutable=false. Also there seem to be no need to expose mutable as an argument of your subclass constructor (ReactEditTextInputConnectionWrapper). I recommend to replace this call with:

super(target, false);

And remove boolean mutable from the list of constructor arguments.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good spot, thanks.


@Override
public boolean setComposingText(CharSequence text, int newCursorPosition) {
final int previousSelectionStart = mEditText.getSelectionStart();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you drop all the final keywords here. It is not common to use final in this context in Java (unlike in JS where you'd use const). Usually final is only used for scoped vars when they are being referenced in anonymous classes ("lambda classes") – in which case you get a compiler error if you forget to use final

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@Override
public boolean endBatchEdit() {
mIsBatchEdit = false;
if(mKey != null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

space: if(mKey -> if (mKey

and make local variables non-final.
@joshjhargreaves
Copy link
Contributor Author

@kmagiera made the changes!

@edo1493
Copy link
Contributor

edo1493 commented Dec 22, 2017

Can we make this happen before Christmas? 🙏

@edo1493
Copy link
Contributor

edo1493 commented Dec 27, 2017

Hey @joshyhargreaves and @shergin, what's the status on this? 🤓

@joshjhargreaves
Copy link
Contributor Author

@kmagiera and I are looking to move this forward after the holiday period.

@brentvatne
Copy link
Collaborator

@facebook-github-bot shipit

@facebook-github-bot facebook-github-bot added the Import Started This pull request has been imported. This does not imply the PR has been approved. label Jan 4, 2018
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brentvatne is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

vincentriemer pushed a commit to vincentriemer/react-native-dom that referenced this pull request Jan 9, 2018
Summary:
This implements onKeyPress for Android on TextInputs and addresses facebook/react-native#1882.
**N.B. that this PR has not yet addressed hardware keyboard inputs**, but doing will be fairly trivial. The main challenge was doing this for soft keyboard inputs.

I've tried to match the style as much as I could. Will happily make any suggested edits be they architectural or stylistic design (edit: and of course implementation), but hopefully this is a good first pass :).
I think important to test this on the most popular keyboard types; maybe different languages too.
I have not yet added tests to test implementation, but will be happy to do that also.

- Build & run RNTester project for Android and open TextInput.
- Enter keys into 'event handling' TextInput.
- Verify that keys you enter appear in onKeyPress below the text input
- Test with autocorrect off, on same input and validate that results are the same.

Below is a gif of PR in action.
![onkeypressandroid](https://user-images.githubusercontent.com/1807207/27512892-3f95c098-5949-11e7-9364-3ce9437f7bb9.gif)
Closes facebook/react-native#14720

Differential Revision: D6661592

Pulled By: hramos

fbshipit-source-id: 5d53772dc2d127b002ea5fb84fa992934eb65a42
mathiasbynens pushed a commit to mathiasbynens/react-native that referenced this pull request Jan 13, 2018
Summary:
This implements onKeyPress for Android on TextInputs and addresses facebook#1882.
**N.B. that this PR has not yet addressed hardware keyboard inputs**, but doing will be fairly trivial. The main challenge was doing this for soft keyboard inputs.

I've tried to match the style as much as I could. Will happily make any suggested edits be they architectural or stylistic design (edit: and of course implementation), but hopefully this is a good first pass :).
I think important to test this on the most popular keyboard types; maybe different languages too.
I have not yet added tests to test implementation, but will be happy to do that also.

- Build & run RNTester project for Android and open TextInput.
- Enter keys into 'event handling' TextInput.
- Verify that keys you enter appear in onKeyPress below the text input
- Test with autocorrect off, on same input and validate that results are the same.

Below is a gif of PR in action.
![onkeypressandroid](https://user-images.githubusercontent.com/1807207/27512892-3f95c098-5949-11e7-9364-3ce9437f7bb9.gif)
Closes facebook#14720

Differential Revision: D6661592

Pulled By: hramos

fbshipit-source-id: 5d53772dc2d127b002ea5fb84fa992934eb65a42
jsm pushed a commit to unclechau/react-native that referenced this pull request Feb 12, 2018
Summary:
This implements onKeyPress for Android on TextInputs and addresses facebook#1882.
**N.B. that this PR has not yet addressed hardware keyboard inputs**, but doing will be fairly trivial. The main challenge was doing this for soft keyboard inputs.

I've tried to match the style as much as I could. Will happily make any suggested edits be they architectural or stylistic design (edit: and of course implementation), but hopefully this is a good first pass :).
I think important to test this on the most popular keyboard types; maybe different languages too.
I have not yet added tests to test implementation, but will be happy to do that also.

- Build & run RNTester project for Android and open TextInput.
- Enter keys into 'event handling' TextInput.
- Verify that keys you enter appear in onKeyPress below the text input
- Test with autocorrect off, on same input and validate that results are the same.

Below is a gif of PR in action.
![onkeypressandroid](https://user-images.githubusercontent.com/1807207/27512892-3f95c098-5949-11e7-9364-3ce9437f7bb9.gif)
Closes facebook#14720

Differential Revision: D6661592

Pulled By: hramos

fbshipit-source-id: 5d53772dc2d127b002ea5fb84fa992934eb65a42
hramos added a commit to hramos/react-native that referenced this pull request Feb 6, 2019
Summary:
@public
This sync includes the following changes:
- **[45fc46bfa](facebook/react@45fc46bfa )**: 16.8.1 packages //<Brian Vaughn>//
- **[f2e2637c8](facebook/react@f2e2637c8 )**: Backwards compat fix for ReactCurrentDispatcher on older react versions (facebook#14770) //<Brian Vaughn>//
- **[1107b9673](facebook/react@1107b9673 )**: [TestUtils.act] warn when using TestUtils.act in node (facebook#14768) //<Sunil Pai>//
- **[0975ea327](facebook/react@0975ea327 )**: eslint-plugin-react-hooks v1.0.0 //<Brian Vaughn>//
- **[bc9818f24](facebook/react@bc9818f24 )**: Scheduler.unstable_next (facebook#14756) //<Andrew Clark>//
- **[ce6ecd3fb](facebook/react@ce6ecd3fb )**: Add 16.8.0 changelog and update some READMEs (facebook#14692) //<Dan Abramov>//
- **[008a2ab9c](facebook/react@008a2ab9c )**: 16.8.0 //<Brian Vaughn>//
- **[d1326f466](facebook/react@d1326f466 )**: [TestUtils.act] fix return result checking  (facebook#14758) //<Sunil Pai>//
- **[267ed9814](facebook/react@267ed9814 )**: expose `TestUtils.act()` for batching actions in tests (facebook#14744) //<Sunil Pai>//
- **[fb3f7bfde](facebook/react@fb3f7bfde )**: Avoid importing Scheduler directly (facebook#14757) //<Andrew Clark>//
- **[e602b5291](facebook/react@e602b5291 )**: Use SameValue instead of === to check for dispatchAction equivalence (facebook#14752) //<Jessica Franco>//
- **[e489c3f9c](facebook/react@e489c3f9c )**: Update the version with Hooks proposal in README (facebook#14751) //<SToneX>//
- **[c21c41ecf](facebook/react@c21c41ecf )**: Tweak invalid Hook warning and error (facebook#14747) //<Dan Abramov>//
- **[fec00a869](facebook/react@fec00a869 )**: Typo in comment (facebook#14739) //<Deniz Susman>//
- **[66eb29374](facebook/react@66eb29374 )**: Restrict effect return type to a function or nothing (facebook#14119) //<Andrew Clark>//
- **[51c07912a](facebook/react@51c07912a )**: Warn when second argument is passed to useCallback (facebook#14729) //<Dan Abramov>//
- **[70d407583](facebook/react@70d407583 )**: Move Hook mismatch warning to first mismatch site (facebook#14720) //<Andrew Clark>//
- **[ba6477aa3](facebook/react@ba6477aa3 )**: Improve Reducer Hook's lazy init API (facebook#14723) //<Andrew Clark>//
- **[cb1ff430e](facebook/react@cb1ff430e )**: Phased dispatcher (facebook#14701) //<Andrew Clark>//
- **[9d483dcfd](facebook/react@9d483dcfd )**: Spelling abitrarily -> arbitrarily (facebook#14710) //<Peter Donald>//
- **[e19c9e106](facebook/react@e19c9e106 )**: Fix issue with multiple code branches in hooks linter (facebook#14661) //<Yurick>//
- **[f11a9c1cb](facebook/react@f11a9c1cb )**: State update bug in concurrent mode (facebook#14698) //<Brian Vaughn>//
- **[e679a4b6e](facebook/react@e679a4b6e )**: Fix typo in code comment (facebook#14696) //<Greg Hurrell>//
- **[8bcc88f2e](facebook/react@8bcc88f2e )**: Make all readContext() and Hook-in-a-Hook checks DEV-only (facebook#14677) //<Dan Abramov>//
- **[6cb26774e](facebook/react@6cb26774e )**: Enable hooks! (facebook#14679) //<Brian Vaughn>//
- **[73962c366](facebook/react@73962c366 )**: Revert "Revert "Double-render function components with Hooks in DEV in StrictMode" (facebook#14652)" (facebook#14654) //<Dan Abramov>//
- **[994439228](facebook/react@994439228 )**: Put DEV-only code into DEV blocks (facebook#14673) //<Dan Abramov>//
- **[f0befae65](facebook/react@f0befae65 )**: Tweak context invariant message (facebook#14671) //<Dan Abramov>//
- **[a129259ad](facebook/react@a129259ad )**: Disallow reading context during useMemo etc (facebook#14653) //<Dan Abramov>//
- **[c068d31cc](facebook/react@c068d31cc )**: Add unit tests for concurrent mode event dispatching (facebook#14415) //<Sebastian Markbåge>//
- **[38247cba3](facebook/react@38247cba3 )**: --save is no longer needed (facebook#14302) //<SamCortopassi>//
- **[3f0bcaf0d](facebook/react@3f0bcaf0d )**: Importing React for the first example. (facebook#14346) //<Ramón Chancay Ortega>//
- **[ecd919a2f](facebook/react@ecd919a2f )**: RFC: warn when returning different hooks on subsequent renders (facebook#14585) //<Sunil Pai>//
- **[3fbebb2a0](facebook/react@3fbebb2a0 )**: Revert "Double-render function components with Hooks in DEV in StrictMode" (facebook#14652) //<Dan Abramov>//
- **[5fce6488c](facebook/react@5fce6488c )**: Revert "Disallow reading context during useMemo etc" (facebook#14651) //<Dan Abramov>//
- **[fe2ecd276](facebook/react@fe2ecd276 )**: Add test coverage for readContext() on the server (facebook#14649) //<Dan Abramov>//
- **[8f45a7fdc](facebook/react@8f45a7fdc )**: Warn about incorrect use of useImperativeHandle() (facebook#14647) //<Dan Abramov>//
- **[1fcbd2243](facebook/react@1fcbd2243 )**: Disallow reading context during useMemo etc (facebook#14648) //<Dan Abramov>//
- **[2a084f51a](facebook/react@2a084f51a )**: Warn about refs on lazy function components (facebook#14645) //<Dan Abramov>//
- **[b5a3df6e8](facebook/react@b5a3df6e8 )**: Fix typo (facebook#14560) //<Linchengyi>//
- **[9c146e675](facebook/react@9c146e675 )**: fix typo (facebook#14316) //<liunian>//
- **[baa6d40fc](facebook/react@baa6d40fc )**: Mention forwardRef() in <Fn ref={...} /> errors and warnings (facebook#14644) //<Dan Abramov>//
- **[a1414e894](facebook/react@a1414e894 )**: Double-render function components with Hooks in DEV in StrictMode (facebook#14643) //<Dan Abramov>//
- **[10a7a5b5c](facebook/react@10a7a5b5c )**: Fix synchronous thenable rejection (facebook#14633) //<Dan Abramov>//
- **[a2fa6eb98](facebook/react@a2fa6eb98 )**: Move lazy._result assignment (facebook#14632) //<Dan Abramov>//
- **[9120f6c2d](facebook/react@9120f6c2d )**: Support sync thenables for lazy() (facebook#14626) //<Dan Abramov>//
- **[b66e6e41e](facebook/react@b66e6e41e )**: Add directory details to the package.json of all packages (facebook#14628) //<Grey Baker>//
- **[177fb7635](facebook/react@177fb7635 )**: Warn when second callback is passed to setState/dispatch in Hooks (facebook#14625) //<Dan Abramov>//
- **[d17d0b99c](facebook/react@d17d0b99c )**: Use public context.report interface in eslint rules (facebook#14623) //<Sebastian Silbermann>//
- **[4f332885a](facebook/react@4f332885a )**: Fix shallow renderer set instance state after gDSFP before calling sCU (facebook#14613) //<Yi-Shan, Chen>//
- **[e1cd83e49](facebook/react@e1cd83e49 )**: Throw an error when using hooks inside useMemo/useState/useReducer, or .memo's comparator (facebook#14608) //<Sunil Pai>//
- **[be457ca68](facebook/react@be457ca68 )**: Small tweaks to SSR to match facebook#14594 (facebook#14618) //<Dan Abramov>//
- **[17d70df91](facebook/react@17d70df91 )**: Warn when mixing createRoot() and old APIs (facebook#14615) //<Dan Abramov>//
- **[4feab7fc9](facebook/react@4feab7fc9 )**: Add hooks support to ReactShallowRenderer (facebook#14567) //<Dominic Gannaway>//
- **[1454a8be0](facebook/react@1454a8be0 )**: Don't bother comparing constructor when deps are not provided (facebook#14594) //<Andrew Clark>//
- **[71b64d521](facebook/react@71b64d521 )**: Warn if number of hooks increases (facebook#14591) //<Andrew Clark>//
- **[790c8ef04](facebook/react@790c8ef04 )**: Allow useReducer to bail out of rendering by returning previous state (facebook#14569) //<Andrew Clark>//
- **[7ab8a8e97](facebook/react@7ab8a8e97 )**: Added Flow type to keep hooks dispatchers in-sync (facebook#14599) //<Brian Vaughn>//
- **[4392e3821](facebook/react@4392e3821 )**: useDebugValue should throw if used in a class component (facebook#14601) //<Brian Vaughn>//
- **[153a0b598](facebook/react@153a0b598 )**: Add noop useDebugValue hook to partial/server renderer (facebook#14597) //<Brian Vaughn>//
- **[7ad9806d1](facebook/react@7ad9806d1 )**: Tweak to avoid property read (facebook#14593) //<Brandon Dail>//
- **[0fc154751](facebook/react@0fc154751 )**: Avoid new Set([iterable]) for thenables (facebook#14592) //<Brandon Dail>//
- **[edb1f5956](facebook/react@edb1f5956 )**: Support configurable labels for custom hooks (facebook#14559) //<Brian Vaughn>//
- **[3e15b1c69](facebook/react@3e15b1c69 )**: make a fork for ReactCurrentDispatcher (facebook#14588) //<Sunil Pai>//
- **[0005d1e3f](facebook/react@0005d1e3f )**: Fix typo (facebook#14576) //<Carl Mungazi>//
- **[f290138d3](facebook/react@f290138d3 )**: react-debug-tools accepts currentDispatcher ref as param (facebook#14556) //<Brian Vaughn>//
- **[b4ad8e947](facebook/react@b4ad8e947 )**: rename useImperativeMethods -> useImperativeHandle (facebook#14565) //<Sunil Pai>//
- **[ab03e3d65](facebook/react@ab03e3d65 )**: Inject ReactCurrentDispatcher ref to DevTools (facebook#14550) //<Brian Vaughn>//
- **[19ef0ec11](facebook/react@19ef0ec11 )**: Separate current owner and dispatcher (facebook#14548) //<Brian Vaughn>//
- **[a9b035b0c](facebook/react@a9b035b0c )**: Separate Object.is polyfill (facebook#14334) //<Maksim Markelov>//
- **[547e059f0](facebook/react@547e059f0 )**: Simplify wording of key warning (facebook#14503) //<Sophie Alpert>//
- **[3494ee57e](facebook/react@3494ee57e )**: Update ReactUpdateQueue.js (facebook#14521) //<Carl Mungazi>//
- **[659c13963](facebook/react@659c13963 )**: Update ReactFiberScheduler.js (facebook#14477) //<Carl Mungazi>//
- **[c695b2384](facebook/react@c695b2384 )**: React v16.7.0 //<Andrew Clark>//
- **[1c5aa2f23](facebook/react@1c5aa2f23 )**: Move SchedulerFeatureFlags fork to src directory to fix lint //<Andrew Clark>//
- **[653bc582f](facebook/react@653bc582f )**: Create separate SchedulerFeatureFlags instead of using ReactFeatureFlags (facebook#14455) //<Andrew Clark>//
- **[8bfef0da5](facebook/react@8bfef0da5 )**: Make scheduler debugging feature flag static //<Andrew Clark>//
- **[4a1072194](facebook/react@4a1072194 )**: Memoize promise listeners to prevent exponential growth (facebook#14429) //<Andrew Clark>//
- **[535804f5c](facebook/react@535804f5c )**: Removed Fabric-specific feature flag files and updated Rollup to use the (non-Fabric) React Native flag files. (facebook#14437) //<Brian Vaughn>//
- **[2743fb7b2](facebook/react@2743fb7b2 )**: Enable hooks by default for FB React Native renderer (facebook#14435) //<Brian Vaughn>//
- **[7325ebe4d](facebook/react@7325ebe4d )**: Inject overrideProps() fn to DevTools (facebook#14427) //<Brian Vaughn>//
- **[a22880e5e](facebook/react@a22880e5e )**: Add support for Suspense & lazy() to the react-is package (facebook#14423) //<Pleun Vanderbauwhede>//
- **[947bddd5c](facebook/react@947bddd5c )**: Remove redundant argument of getPlugins function (facebook#14419) //<Heaven>//
- **[8df4d59be](facebook/react@8df4d59be )**: Implement pauseExecution, continueExecution, dumpQueue for Scheduler (facebook#14053) //<Kevin Chavez>//
- **[5bb4ad737](facebook/react@5bb4ad737 )**: Added ErrorBoundary tests for useEffect and useLayoutEffect (facebook#14401) //<Brian Vaughn>//
- **[98eb5ae53](facebook/react@98eb5ae53 )**: TestRenderer toJSON should not expose the Array wrapper Suspense uses for hidden trees (facebook#14392) //<Brian Vaughn>//
- **[39489e767](facebook/react@39489e767 )**: Enable hooks in fabric (facebook#14301) //<Spencer Ahrens>//
- **[1dc108e58](facebook/react@1dc108e58 )**: Tweaked wording for v8 "performance cliff" issue //<Brian Vaughn>//

Release Notes:
[GENERAL] [Changed] - React sync for revisions 6bf5e85...aa94237 (React 16.8.1)

Differential Revision: D13976467

fbshipit-source-id: 728fbf4fecde33184b6b36f863f2dfe940becc27
hramos added a commit to hramos/react-native that referenced this pull request Feb 7, 2019
Summary:
Pull Request resolved: facebook#23320

@public
This sync includes the following changes:
- **[45fc46bfa](facebook/react@45fc46bfa )**: 16.8.1 packages //<Brian Vaughn>//
- **[f2e2637c8](facebook/react@f2e2637c8 )**: Backwards compat fix for ReactCurrentDispatcher on older react versions (facebook#14770) //<Brian Vaughn>//
- **[1107b9673](facebook/react@1107b9673 )**: [TestUtils.act] warn when using TestUtils.act in node (facebook#14768) //<Sunil Pai>//
- **[0975ea327](facebook/react@0975ea327 )**: eslint-plugin-react-hooks v1.0.0 //<Brian Vaughn>//
- **[bc9818f24](facebook/react@bc9818f24 )**: Scheduler.unstable_next (facebook#14756) //<Andrew Clark>//
- **[ce6ecd3fb](facebook/react@ce6ecd3fb )**: Add 16.8.0 changelog and update some READMEs (facebook#14692) //<Dan Abramov>//
- **[008a2ab9c](facebook/react@008a2ab9c )**: 16.8.0 //<Brian Vaughn>//
- **[d1326f466](facebook/react@d1326f466 )**: [TestUtils.act] fix return result checking  (facebook#14758) //<Sunil Pai>//
- **[267ed9814](facebook/react@267ed9814 )**: expose `TestUtils.act()` for batching actions in tests (facebook#14744) //<Sunil Pai>//
- **[fb3f7bfde](facebook/react@fb3f7bfde )**: Avoid importing Scheduler directly (facebook#14757) //<Andrew Clark>//
- **[e602b5291](facebook/react@e602b5291 )**: Use SameValue instead of === to check for dispatchAction equivalence (facebook#14752) //<Jessica Franco>//
- **[e489c3f9c](facebook/react@e489c3f9c )**: Update the version with Hooks proposal in README (facebook#14751) //<SToneX>//
- **[c21c41ecf](facebook/react@c21c41ecf )**: Tweak invalid Hook warning and error (facebook#14747) //<Dan Abramov>//
- **[fec00a869](facebook/react@fec00a869 )**: Typo in comment (facebook#14739) //<Deniz Susman>//
- **[66eb29374](facebook/react@66eb29374 )**: Restrict effect return type to a function or nothing (facebook#14119) //<Andrew Clark>//
- **[51c07912a](facebook/react@51c07912a )**: Warn when second argument is passed to useCallback (facebook#14729) //<Dan Abramov>//
- **[70d407583](facebook/react@70d407583 )**: Move Hook mismatch warning to first mismatch site (facebook#14720) //<Andrew Clark>//
- **[ba6477aa3](facebook/react@ba6477aa3 )**: Improve Reducer Hook's lazy init API (facebook#14723) //<Andrew Clark>//
- **[cb1ff430e](facebook/react@cb1ff430e )**: Phased dispatcher (facebook#14701) //<Andrew Clark>//
- **[9d483dcfd](facebook/react@9d483dcfd )**: Spelling abitrarily -> arbitrarily (facebook#14710) //<Peter Donald>//
- **[e19c9e106](facebook/react@e19c9e106 )**: Fix issue with multiple code branches in hooks linter (facebook#14661) //<Yurick>//
- **[f11a9c1cb](facebook/react@f11a9c1cb )**: State update bug in concurrent mode (facebook#14698) //<Brian Vaughn>//
- **[e679a4b6e](facebook/react@e679a4b6e )**: Fix typo in code comment (facebook#14696) //<Greg Hurrell>//
- **[8bcc88f2e](facebook/react@8bcc88f2e )**: Make all readContext() and Hook-in-a-Hook checks DEV-only (facebook#14677) //<Dan Abramov>//
- **[6cb26774e](facebook/react@6cb26774e )**: Enable hooks! (facebook#14679) //<Brian Vaughn>//
- **[73962c366](facebook/react@73962c366 )**: Revert "Revert "Double-render function components with Hooks in DEV in StrictMode" (facebook#14652)" (facebook#14654) //<Dan Abramov>//
- **[994439228](facebook/react@994439228 )**: Put DEV-only code into DEV blocks (facebook#14673) //<Dan Abramov>//
- **[f0befae65](facebook/react@f0befae65 )**: Tweak context invariant message (facebook#14671) //<Dan Abramov>//
- **[a129259ad](facebook/react@a129259ad )**: Disallow reading context during useMemo etc (facebook#14653) //<Dan Abramov>//
- **[c068d31cc](facebook/react@c068d31cc )**: Add unit tests for concurrent mode event dispatching (facebook#14415) //<Sebastian Markbåge>//
- **[38247cba3](facebook/react@38247cba3 )**: --save is no longer needed (facebook#14302) //<SamCortopassi>//
- **[3f0bcaf0d](facebook/react@3f0bcaf0d )**: Importing React for the first example. (facebook#14346) //<Ramón Chancay Ortega>//
- **[ecd919a2f](facebook/react@ecd919a2f )**: RFC: warn when returning different hooks on subsequent renders (facebook#14585) //<Sunil Pai>//
- **[3fbebb2a0](facebook/react@3fbebb2a0 )**: Revert "Double-render function components with Hooks in DEV in StrictMode" (facebook#14652) //<Dan Abramov>//
- **[5fce6488c](facebook/react@5fce6488c )**: Revert "Disallow reading context during useMemo etc" (facebook#14651) //<Dan Abramov>//
- **[fe2ecd276](facebook/react@fe2ecd276 )**: Add test coverage for readContext() on the server (facebook#14649) //<Dan Abramov>//
- **[8f45a7fdc](facebook/react@8f45a7fdc )**: Warn about incorrect use of useImperativeHandle() (facebook#14647) //<Dan Abramov>//
- **[1fcbd2243](facebook/react@1fcbd2243 )**: Disallow reading context during useMemo etc (facebook#14648) //<Dan Abramov>//
- **[2a084f51a](facebook/react@2a084f51a )**: Warn about refs on lazy function components (facebook#14645) //<Dan Abramov>//
- **[b5a3df6e8](facebook/react@b5a3df6e8 )**: Fix typo (facebook#14560) //<Linchengyi>//
- **[9c146e675](facebook/react@9c146e675 )**: fix typo (facebook#14316) //<liunian>//
- **[baa6d40fc](facebook/react@baa6d40fc )**: Mention forwardRef() in <Fn ref={...} /> errors and warnings (facebook#14644) //<Dan Abramov>//
- **[a1414e894](facebook/react@a1414e894 )**: Double-render function components with Hooks in DEV in StrictMode (facebook#14643) //<Dan Abramov>//
- **[10a7a5b5c](facebook/react@10a7a5b5c )**: Fix synchronous thenable rejection (facebook#14633) //<Dan Abramov>//
- **[a2fa6eb98](facebook/react@a2fa6eb98 )**: Move lazy._result assignment (facebook#14632) //<Dan Abramov>//
- **[9120f6c2d](facebook/react@9120f6c2d )**: Support sync thenables for lazy() (facebook#14626) //<Dan Abramov>//
- **[b66e6e41e](facebook/react@b66e6e41e )**: Add directory details to the package.json of all packages (facebook#14628) //<Grey Baker>//
- **[177fb7635](facebook/react@177fb7635 )**: Warn when second callback is passed to setState/dispatch in Hooks (facebook#14625) //<Dan Abramov>//
- **[d17d0b99c](facebook/react@d17d0b99c )**: Use public context.report interface in eslint rules (facebook#14623) //<Sebastian Silbermann>//
- **[4f332885a](facebook/react@4f332885a )**: Fix shallow renderer set instance state after gDSFP before calling sCU (facebook#14613) //<Yi-Shan, Chen>//
- **[e1cd83e49](facebook/react@e1cd83e49 )**: Throw an error when using hooks inside useMemo/useState/useReducer, or .memo's comparator (facebook#14608) //<Sunil Pai>//
- **[be457ca68](facebook/react@be457ca68 )**: Small tweaks to SSR to match facebook#14594 (facebook#14618) //<Dan Abramov>//
- **[17d70df91](facebook/react@17d70df91 )**: Warn when mixing createRoot() and old APIs (facebook#14615) //<Dan Abramov>//
- **[4feab7fc9](facebook/react@4feab7fc9 )**: Add hooks support to ReactShallowRenderer (facebook#14567) //<Dominic Gannaway>//
- **[1454a8be0](facebook/react@1454a8be0 )**: Don't bother comparing constructor when deps are not provided (facebook#14594) //<Andrew Clark>//
- **[71b64d521](facebook/react@71b64d521 )**: Warn if number of hooks increases (facebook#14591) //<Andrew Clark>//
- **[790c8ef04](facebook/react@790c8ef04 )**: Allow useReducer to bail out of rendering by returning previous state (facebook#14569) //<Andrew Clark>//
- **[7ab8a8e97](facebook/react@7ab8a8e97 )**: Added Flow type to keep hooks dispatchers in-sync (facebook#14599) //<Brian Vaughn>//
- **[4392e3821](facebook/react@4392e3821 )**: useDebugValue should throw if used in a class component (facebook#14601) //<Brian Vaughn>//
- **[153a0b598](facebook/react@153a0b598 )**: Add noop useDebugValue hook to partial/server renderer (facebook#14597) //<Brian Vaughn>//
- **[7ad9806d1](facebook/react@7ad9806d1 )**: Tweak to avoid property read (facebook#14593) //<Brandon Dail>//
- **[0fc154751](facebook/react@0fc154751 )**: Avoid new Set([iterable]) for thenables (facebook#14592) //<Brandon Dail>//
- **[edb1f5956](facebook/react@edb1f5956 )**: Support configurable labels for custom hooks (facebook#14559) //<Brian Vaughn>//
- **[3e15b1c69](facebook/react@3e15b1c69 )**: make a fork for ReactCurrentDispatcher (facebook#14588) //<Sunil Pai>//
- **[0005d1e3f](facebook/react@0005d1e3f )**: Fix typo (facebook#14576) //<Carl Mungazi>//
- **[f290138d3](facebook/react@f290138d3 )**: react-debug-tools accepts currentDispatcher ref as param (facebook#14556) //<Brian Vaughn>//
- **[b4ad8e947](facebook/react@b4ad8e947 )**: rename useImperativeMethods -> useImperativeHandle (facebook#14565) //<Sunil Pai>//
- **[ab03e3d65](facebook/react@ab03e3d65 )**: Inject ReactCurrentDispatcher ref to DevTools (facebook#14550) //<Brian Vaughn>//
- **[19ef0ec11](facebook/react@19ef0ec11 )**: Separate current owner and dispatcher (facebook#14548) //<Brian Vaughn>//
- **[a9b035b0c](facebook/react@a9b035b0c )**: Separate Object.is polyfill (facebook#14334) //<Maksim Markelov>//
- **[547e059f0](facebook/react@547e059f0 )**: Simplify wording of key warning (facebook#14503) //<Sophie Alpert>//
- **[3494ee57e](facebook/react@3494ee57e )**: Update ReactUpdateQueue.js (facebook#14521) //<Carl Mungazi>//
- **[659c13963](facebook/react@659c13963 )**: Update ReactFiberScheduler.js (facebook#14477) //<Carl Mungazi>//
- **[c695b2384](facebook/react@c695b2384 )**: React v16.7.0 //<Andrew Clark>//
- **[1c5aa2f23](facebook/react@1c5aa2f23 )**: Move SchedulerFeatureFlags fork to src directory to fix lint //<Andrew Clark>//
- **[653bc582f](facebook/react@653bc582f )**: Create separate SchedulerFeatureFlags instead of using ReactFeatureFlags (facebook#14455) //<Andrew Clark>//
- **[8bfef0da5](facebook/react@8bfef0da5 )**: Make scheduler debugging feature flag static //<Andrew Clark>//
- **[4a1072194](facebook/react@4a1072194 )**: Memoize promise listeners to prevent exponential growth (facebook#14429) //<Andrew Clark>//
- **[535804f5c](facebook/react@535804f5c )**: Removed Fabric-specific feature flag files and updated Rollup to use the (non-Fabric) React Native flag files. (facebook#14437) //<Brian Vaughn>//
- **[2743fb7b2](facebook/react@2743fb7b2 )**: Enable hooks by default for FB React Native renderer (facebook#14435) //<Brian Vaughn>//
- **[7325ebe4d](facebook/react@7325ebe4d )**: Inject overrideProps() fn to DevTools (facebook#14427) //<Brian Vaughn>//
- **[a22880e5e](facebook/react@a22880e5e )**: Add support for Suspense & lazy() to the react-is package (facebook#14423) //<Pleun Vanderbauwhede>//
- **[947bddd5c](facebook/react@947bddd5c )**: Remove redundant argument of getPlugins function (facebook#14419) //<Heaven>//
- **[8df4d59be](facebook/react@8df4d59be )**: Implement pauseExecution, continueExecution, dumpQueue for Scheduler (facebook#14053) //<Kevin Chavez>//
- **[5bb4ad737](facebook/react@5bb4ad737 )**: Added ErrorBoundary tests for useEffect and useLayoutEffect (facebook#14401) //<Brian Vaughn>//
- **[98eb5ae53](facebook/react@98eb5ae53 )**: TestRenderer toJSON should not expose the Array wrapper Suspense uses for hidden trees (facebook#14392) //<Brian Vaughn>//
- **[39489e767](facebook/react@39489e767 )**: Enable hooks in fabric (facebook#14301) //<Spencer Ahrens>//
- **[1dc108e58](facebook/react@1dc108e58 )**: Tweaked wording for v8 "performance cliff" issue //<Brian Vaughn>//

Release Notes:
[GENERAL] [Changed] - React sync for revisions 6bf5e85...aa94237 (React 16.8.1)

Differential Revision: D13976467

fbshipit-source-id: 72db51d098109081c19bce79129a7bb5932d77f5
hramos added a commit to hramos/react-native that referenced this pull request Feb 7, 2019
Summary:
This sync includes the following changes:
- **[45fc46bfa](facebook/react@45fc46bfa )**: 16.8.1 packages //<Brian Vaughn>//
- **[f2e2637c8](facebook/react@f2e2637c8 )**: Backwards compat fix for ReactCurrentDispatcher on older react versions (facebook#14770) //<Brian Vaughn>//
- **[1107b9673](facebook/react@1107b9673 )**: [TestUtils.act] warn when using TestUtils.act in node (facebook#14768) //<Sunil Pai>//
- **[0975ea327](facebook/react@0975ea327 )**: eslint-plugin-react-hooks v1.0.0 //<Brian Vaughn>//
- **[bc9818f24](facebook/react@bc9818f24 )**: Scheduler.unstable_next (facebook#14756) //<Andrew Clark>//
- **[ce6ecd3fb](facebook/react@ce6ecd3fb )**: Add 16.8.0 changelog and update some READMEs (facebook#14692) //<Dan Abramov>//
- **[008a2ab9c](facebook/react@008a2ab9c )**: 16.8.0 //<Brian Vaughn>//
- **[d1326f466](facebook/react@d1326f466 )**: [TestUtils.act] fix return result checking  (facebook#14758) //<Sunil Pai>//
- **[267ed9814](facebook/react@267ed9814 )**: expose `TestUtils.act()` for batching actions in tests (facebook#14744) //<Sunil Pai>//
- **[fb3f7bfde](facebook/react@fb3f7bfde )**: Avoid importing Scheduler directly (facebook#14757) //<Andrew Clark>//
- **[e602b5291](facebook/react@e602b5291 )**: Use SameValue instead of === to check for dispatchAction equivalence (facebook#14752) //<Jessica Franco>//
- **[e489c3f9c](facebook/react@e489c3f9c )**: Update the version with Hooks proposal in README (facebook#14751) //<SToneX>//
- **[c21c41ecf](facebook/react@c21c41ecf )**: Tweak invalid Hook warning and error (facebook#14747) //<Dan Abramov>//
- **[fec00a869](facebook/react@fec00a869 )**: Typo in comment (facebook#14739) //<Deniz Susman>//
- **[66eb29374](facebook/react@66eb29374 )**: Restrict effect return type to a function or nothing (facebook#14119) //<Andrew Clark>//
- **[51c07912a](facebook/react@51c07912a )**: Warn when second argument is passed to useCallback (facebook#14729) //<Dan Abramov>//
- **[70d407583](facebook/react@70d407583 )**: Move Hook mismatch warning to first mismatch site (facebook#14720) //<Andrew Clark>//
- **[ba6477aa3](facebook/react@ba6477aa3 )**: Improve Reducer Hook's lazy init API (facebook#14723) //<Andrew Clark>//
- **[cb1ff430e](facebook/react@cb1ff430e )**: Phased dispatcher (facebook#14701) //<Andrew Clark>//
- **[9d483dcfd](facebook/react@9d483dcfd )**: Spelling abitrarily -> arbitrarily (facebook#14710) //<Peter Donald>//
- **[e19c9e106](facebook/react@e19c9e106 )**: Fix issue with multiple code branches in hooks linter (facebook#14661) //<Yurick>//
- **[f11a9c1cb](facebook/react@f11a9c1cb )**: State update bug in concurrent mode (facebook#14698) //<Brian Vaughn>//
- **[e679a4b6e](facebook/react@e679a4b6e )**: Fix typo in code comment (facebook#14696) //<Greg Hurrell>//
- **[8bcc88f2e](facebook/react@8bcc88f2e )**: Make all readContext() and Hook-in-a-Hook checks DEV-only (facebook#14677) //<Dan Abramov>//
- **[6cb26774e](facebook/react@6cb26774e )**: Enable hooks! (facebook#14679) //<Brian Vaughn>//
- **[73962c366](facebook/react@73962c366 )**: Revert "Revert "Double-render function components with Hooks in DEV in StrictMode" (facebook#14652)" (facebook#14654) //<Dan Abramov>//
- **[994439228](facebook/react@994439228 )**: Put DEV-only code into DEV blocks (facebook#14673) //<Dan Abramov>//
- **[f0befae65](facebook/react@f0befae65 )**: Tweak context invariant message (facebook#14671) //<Dan Abramov>//
- **[a129259ad](facebook/react@a129259ad )**: Disallow reading context during useMemo etc (facebook#14653) //<Dan Abramov>//
- **[c068d31cc](facebook/react@c068d31cc )**: Add unit tests for concurrent mode event dispatching (facebook#14415) //<Sebastian Markbåge>//
- **[38247cba3](facebook/react@38247cba3 )**: --save is no longer needed (facebook#14302) //<SamCortopassi>//
- **[3f0bcaf0d](facebook/react@3f0bcaf0d )**: Importing React for the first example. (facebook#14346) //<Ramón Chancay Ortega>//
- **[ecd919a2f](facebook/react@ecd919a2f )**: RFC: warn when returning different hooks on subsequent renders (facebook#14585) //<Sunil Pai>//
- **[3fbebb2a0](facebook/react@3fbebb2a0 )**: Revert "Double-render function components with Hooks in DEV in StrictMode" (facebook#14652) //<Dan Abramov>//
- **[5fce6488c](facebook/react@5fce6488c )**: Revert "Disallow reading context during useMemo etc" (facebook#14651) //<Dan Abramov>//
- **[fe2ecd276](facebook/react@fe2ecd276 )**: Add test coverage for readContext() on the server (facebook#14649) //<Dan Abramov>//
- **[8f45a7fdc](facebook/react@8f45a7fdc )**: Warn about incorrect use of useImperativeHandle() (facebook#14647) //<Dan Abramov>//
- **[1fcbd2243](facebook/react@1fcbd2243 )**: Disallow reading context during useMemo etc (facebook#14648) //<Dan Abramov>//
- **[2a084f51a](facebook/react@2a084f51a )**: Warn about refs on lazy function components (facebook#14645) //<Dan Abramov>//
- **[b5a3df6e8](facebook/react@b5a3df6e8 )**: Fix typo (facebook#14560) //<Linchengyi>//
- **[9c146e675](facebook/react@9c146e675 )**: fix typo (facebook#14316) //<liunian>//
- **[baa6d40fc](facebook/react@baa6d40fc )**: Mention forwardRef() in <Fn ref={...} /> errors and warnings (facebook#14644) //<Dan Abramov>//
- **[a1414e894](facebook/react@a1414e894 )**: Double-render function components with Hooks in DEV in StrictMode (facebook#14643) //<Dan Abramov>//
- **[10a7a5b5c](facebook/react@10a7a5b5c )**: Fix synchronous thenable rejection (facebook#14633) //<Dan Abramov>//
- **[a2fa6eb98](facebook/react@a2fa6eb98 )**: Move lazy._result assignment (facebook#14632) //<Dan Abramov>//
- **[9120f6c2d](facebook/react@9120f6c2d )**: Support sync thenables for lazy() (facebook#14626) //<Dan Abramov>//
- **[b66e6e41e](facebook/react@b66e6e41e )**: Add directory details to the package.json of all packages (facebook#14628) //<Grey Baker>//
- **[177fb7635](facebook/react@177fb7635 )**: Warn when second callback is passed to setState/dispatch in Hooks (facebook#14625) //<Dan Abramov>//
- **[d17d0b99c](facebook/react@d17d0b99c )**: Use public context.report interface in eslint rules (facebook#14623) //<Sebastian Silbermann>//
- **[4f332885a](facebook/react@4f332885a )**: Fix shallow renderer set instance state after gDSFP before calling sCU (facebook#14613) //<Yi-Shan, Chen>//
- **[e1cd83e49](facebook/react@e1cd83e49 )**: Throw an error when using hooks inside useMemo/useState/useReducer, or .memo's comparator (facebook#14608) //<Sunil Pai>//
- **[be457ca68](facebook/react@be457ca68 )**: Small tweaks to SSR to match facebook#14594 (facebook#14618) //<Dan Abramov>//
- **[17d70df91](facebook/react@17d70df91 )**: Warn when mixing createRoot() and old APIs (facebook#14615) //<Dan Abramov>//
- **[4feab7fc9](facebook/react@4feab7fc9 )**: Add hooks support to ReactShallowRenderer (facebook#14567) //<Dominic Gannaway>//
- **[1454a8be0](facebook/react@1454a8be0 )**: Don't bother comparing constructor when deps are not provided (facebook#14594) //<Andrew Clark>//
- **[71b64d521](facebook/react@71b64d521 )**: Warn if number of hooks increases (facebook#14591) //<Andrew Clark>//
- **[790c8ef04](facebook/react@790c8ef04 )**: Allow useReducer to bail out of rendering by returning previous state (facebook#14569) //<Andrew Clark>//
- **[7ab8a8e97](facebook/react@7ab8a8e97 )**: Added Flow type to keep hooks dispatchers in-sync (facebook#14599) //<Brian Vaughn>//
- **[4392e3821](facebook/react@4392e3821 )**: useDebugValue should throw if used in a class component (facebook#14601) //<Brian Vaughn>//
- **[153a0b598](facebook/react@153a0b598 )**: Add noop useDebugValue hook to partial/server renderer (facebook#14597) //<Brian Vaughn>//
- **[7ad9806d1](facebook/react@7ad9806d1 )**: Tweak to avoid property read (facebook#14593) //<Brandon Dail>//
- **[0fc154751](facebook/react@0fc154751 )**: Avoid new Set([iterable]) for thenables (facebook#14592) //<Brandon Dail>//
- **[edb1f5956](facebook/react@edb1f5956 )**: Support configurable labels for custom hooks (facebook#14559) //<Brian Vaughn>//
- **[3e15b1c69](facebook/react@3e15b1c69 )**: make a fork for ReactCurrentDispatcher (facebook#14588) //<Sunil Pai>//
- **[0005d1e3f](facebook/react@0005d1e3f )**: Fix typo (facebook#14576) //<Carl Mungazi>//
- **[f290138d3](facebook/react@f290138d3 )**: react-debug-tools accepts currentDispatcher ref as param (facebook#14556) //<Brian Vaughn>//
- **[b4ad8e947](facebook/react@b4ad8e947 )**: rename useImperativeMethods -> useImperativeHandle (facebook#14565) //<Sunil Pai>//
- **[ab03e3d65](facebook/react@ab03e3d65 )**: Inject ReactCurrentDispatcher ref to DevTools (facebook#14550) //<Brian Vaughn>//
- **[19ef0ec11](facebook/react@19ef0ec11 )**: Separate current owner and dispatcher (facebook#14548) //<Brian Vaughn>//
- **[a9b035b0c](facebook/react@a9b035b0c )**: Separate Object.is polyfill (facebook#14334) //<Maksim Markelov>//
- **[547e059f0](facebook/react@547e059f0 )**: Simplify wording of key warning (facebook#14503) //<Sophie Alpert>//
- **[3494ee57e](facebook/react@3494ee57e )**: Update ReactUpdateQueue.js (facebook#14521) //<Carl Mungazi>//
- **[659c13963](facebook/react@659c13963 )**: Update ReactFiberScheduler.js (facebook#14477) //<Carl Mungazi>//
- **[c695b2384](facebook/react@c695b2384 )**: React v16.7.0 //<Andrew Clark>//
- **[1c5aa2f23](facebook/react@1c5aa2f23 )**: Move SchedulerFeatureFlags fork to src directory to fix lint //<Andrew Clark>//
- **[653bc582f](facebook/react@653bc582f )**: Create separate SchedulerFeatureFlags instead of using ReactFeatureFlags (facebook#14455) //<Andrew Clark>//
- **[8bfef0da5](facebook/react@8bfef0da5 )**: Make scheduler debugging feature flag static //<Andrew Clark>//
- **[4a1072194](facebook/react@4a1072194 )**: Memoize promise listeners to prevent exponential growth (facebook#14429) //<Andrew Clark>//
- **[535804f5c](facebook/react@535804f5c )**: Removed Fabric-specific feature flag files and updated Rollup to use the (non-Fabric) React Native flag files. (facebook#14437) //<Brian Vaughn>//
- **[2743fb7b2](facebook/react@2743fb7b2 )**: Enable hooks by default for FB React Native renderer (facebook#14435) //<Brian Vaughn>//
- **[7325ebe4d](facebook/react@7325ebe4d )**: Inject overrideProps() fn to DevTools (facebook#14427) //<Brian Vaughn>//
- **[a22880e5e](facebook/react@a22880e5e )**: Add support for Suspense & lazy() to the react-is package (facebook#14423) //<Pleun Vanderbauwhede>//
- **[947bddd5c](facebook/react@947bddd5c )**: Remove redundant argument of getPlugins function (facebook#14419) //<Heaven>//
- **[8df4d59be](facebook/react@8df4d59be )**: Implement pauseExecution, continueExecution, dumpQueue for Scheduler (facebook#14053) //<Kevin Chavez>//
- **[5bb4ad737](facebook/react@5bb4ad737 )**: Added ErrorBoundary tests for useEffect and useLayoutEffect (facebook#14401) //<Brian Vaughn>//
- **[98eb5ae53](facebook/react@98eb5ae53 )**: TestRenderer toJSON should not expose the Array wrapper Suspense uses for hidden trees (facebook#14392) //<Brian Vaughn>//
- **[39489e767](facebook/react@39489e767 )**: Enable hooks in fabric (facebook#14301) //<Spencer Ahrens>//
- **[1dc108e58](facebook/react@1dc108e58 )**: Tweaked wording for v8 "performance cliff" issue //<Brian Vaughn>//

Release Notes:
[GENERAL] [Changed] - React sync for revisions 6bf5e85...aa94237 (React 16.8.1)

Pull Request resolved: facebook#23320

Differential Revision: D13976467

fbshipit-source-id: 4d169f105c8964741cf3d8f9bc192d9955637cea
hramos added a commit to hramos/react-native that referenced this pull request Feb 7, 2019
Summary:
This sync includes the following changes:
- **[45fc46bfa](facebook/react@45fc46bfa )**: 16.8.1 packages //<Brian Vaughn>//
- **[f2e2637c8](facebook/react@f2e2637c8 )**: Backwards compat fix for ReactCurrentDispatcher on older react versions (facebook#14770) //<Brian Vaughn>//
- **[1107b9673](facebook/react@1107b9673 )**: [TestUtils.act] warn when using TestUtils.act in node (facebook#14768) //<Sunil Pai>//
- **[0975ea327](facebook/react@0975ea327 )**: eslint-plugin-react-hooks v1.0.0 //<Brian Vaughn>//
- **[bc9818f24](facebook/react@bc9818f24 )**: Scheduler.unstable_next (facebook#14756) //<Andrew Clark>//
- **[ce6ecd3fb](facebook/react@ce6ecd3fb )**: Add 16.8.0 changelog and update some READMEs (facebook#14692) //<Dan Abramov>//
- **[008a2ab9c](facebook/react@008a2ab9c )**: 16.8.0 //<Brian Vaughn>//
- **[d1326f466](facebook/react@d1326f466 )**: [TestUtils.act] fix return result checking  (facebook#14758) //<Sunil Pai>//
- **[267ed9814](facebook/react@267ed9814 )**: expose `TestUtils.act()` for batching actions in tests (facebook#14744) //<Sunil Pai>//
- **[fb3f7bfde](facebook/react@fb3f7bfde )**: Avoid importing Scheduler directly (facebook#14757) //<Andrew Clark>//
- **[e602b5291](facebook/react@e602b5291 )**: Use SameValue instead of === to check for dispatchAction equivalence (facebook#14752) //<Jessica Franco>//
- **[e489c3f9c](facebook/react@e489c3f9c )**: Update the version with Hooks proposal in README (facebook#14751) //<SToneX>//
- **[c21c41ecf](facebook/react@c21c41ecf )**: Tweak invalid Hook warning and error (facebook#14747) //<Dan Abramov>//
- **[fec00a869](facebook/react@fec00a869 )**: Typo in comment (facebook#14739) //<Deniz Susman>//
- **[66eb29374](facebook/react@66eb29374 )**: Restrict effect return type to a function or nothing (facebook#14119) //<Andrew Clark>//
- **[51c07912a](facebook/react@51c07912a )**: Warn when second argument is passed to useCallback (facebook#14729) //<Dan Abramov>//
- **[70d407583](facebook/react@70d407583 )**: Move Hook mismatch warning to first mismatch site (facebook#14720) //<Andrew Clark>//
- **[ba6477aa3](facebook/react@ba6477aa3 )**: Improve Reducer Hook's lazy init API (facebook#14723) //<Andrew Clark>//
- **[cb1ff430e](facebook/react@cb1ff430e )**: Phased dispatcher (facebook#14701) //<Andrew Clark>//
- **[9d483dcfd](facebook/react@9d483dcfd )**: Spelling abitrarily -> arbitrarily (facebook#14710) //<Peter Donald>//
- **[e19c9e106](facebook/react@e19c9e106 )**: Fix issue with multiple code branches in hooks linter (facebook#14661) //<Yurick>//
- **[f11a9c1cb](facebook/react@f11a9c1cb )**: State update bug in concurrent mode (facebook#14698) //<Brian Vaughn>//
- **[e679a4b6e](facebook/react@e679a4b6e )**: Fix typo in code comment (facebook#14696) //<Greg Hurrell>//
- **[8bcc88f2e](facebook/react@8bcc88f2e )**: Make all readContext() and Hook-in-a-Hook checks DEV-only (facebook#14677) //<Dan Abramov>//
- **[6cb26774e](facebook/react@6cb26774e )**: Enable hooks! (facebook#14679) //<Brian Vaughn>//
- **[73962c366](facebook/react@73962c366 )**: Revert "Revert "Double-render function components with Hooks in DEV in StrictMode" (facebook#14652)" (facebook#14654) //<Dan Abramov>//
- **[994439228](facebook/react@994439228 )**: Put DEV-only code into DEV blocks (facebook#14673) //<Dan Abramov>//
- **[f0befae65](facebook/react@f0befae65 )**: Tweak context invariant message (facebook#14671) //<Dan Abramov>//
- **[a129259ad](facebook/react@a129259ad )**: Disallow reading context during useMemo etc (facebook#14653) //<Dan Abramov>//
- **[c068d31cc](facebook/react@c068d31cc )**: Add unit tests for concurrent mode event dispatching (facebook#14415) //<Sebastian Markbåge>//
- **[38247cba3](facebook/react@38247cba3 )**: --save is no longer needed (facebook#14302) //<SamCortopassi>//
- **[3f0bcaf0d](facebook/react@3f0bcaf0d )**: Importing React for the first example. (facebook#14346) //<Ramón Chancay Ortega>//
- **[ecd919a2f](facebook/react@ecd919a2f )**: RFC: warn when returning different hooks on subsequent renders (facebook#14585) //<Sunil Pai>//
- **[3fbebb2a0](facebook/react@3fbebb2a0 )**: Revert "Double-render function components with Hooks in DEV in StrictMode" (facebook#14652) //<Dan Abramov>//
- **[5fce6488c](facebook/react@5fce6488c )**: Revert "Disallow reading context during useMemo etc" (facebook#14651) //<Dan Abramov>//
- **[fe2ecd276](facebook/react@fe2ecd276 )**: Add test coverage for readContext() on the server (facebook#14649) //<Dan Abramov>//
- **[8f45a7fdc](facebook/react@8f45a7fdc )**: Warn about incorrect use of useImperativeHandle() (facebook#14647) //<Dan Abramov>//
- **[1fcbd2243](facebook/react@1fcbd2243 )**: Disallow reading context during useMemo etc (facebook#14648) //<Dan Abramov>//
- **[2a084f51a](facebook/react@2a084f51a )**: Warn about refs on lazy function components (facebook#14645) //<Dan Abramov>//
- **[b5a3df6e8](facebook/react@b5a3df6e8 )**: Fix typo (facebook#14560) //<Linchengyi>//
- **[9c146e675](facebook/react@9c146e675 )**: fix typo (facebook#14316) //<liunian>//
- **[baa6d40fc](facebook/react@baa6d40fc )**: Mention forwardRef() in <Fn ref={...} /> errors and warnings (facebook#14644) //<Dan Abramov>//
- **[a1414e894](facebook/react@a1414e894 )**: Double-render function components with Hooks in DEV in StrictMode (facebook#14643) //<Dan Abramov>//
- **[10a7a5b5c](facebook/react@10a7a5b5c )**: Fix synchronous thenable rejection (facebook#14633) //<Dan Abramov>//
- **[a2fa6eb98](facebook/react@a2fa6eb98 )**: Move lazy._result assignment (facebook#14632) //<Dan Abramov>//
- **[9120f6c2d](facebook/react@9120f6c2d )**: Support sync thenables for lazy() (facebook#14626) //<Dan Abramov>//
- **[b66e6e41e](facebook/react@b66e6e41e )**: Add directory details to the package.json of all packages (facebook#14628) //<Grey Baker>//
- **[177fb7635](facebook/react@177fb7635 )**: Warn when second callback is passed to setState/dispatch in Hooks (facebook#14625) //<Dan Abramov>//
- **[d17d0b99c](facebook/react@d17d0b99c )**: Use public context.report interface in eslint rules (facebook#14623) //<Sebastian Silbermann>//
- **[4f332885a](facebook/react@4f332885a )**: Fix shallow renderer set instance state after gDSFP before calling sCU (facebook#14613) //<Yi-Shan, Chen>//
- **[e1cd83e49](facebook/react@e1cd83e49 )**: Throw an error when using hooks inside useMemo/useState/useReducer, or .memo's comparator (facebook#14608) //<Sunil Pai>//
- **[be457ca68](facebook/react@be457ca68 )**: Small tweaks to SSR to match facebook#14594 (facebook#14618) //<Dan Abramov>//
- **[17d70df91](facebook/react@17d70df91 )**: Warn when mixing createRoot() and old APIs (facebook#14615) //<Dan Abramov>//
- **[4feab7fc9](facebook/react@4feab7fc9 )**: Add hooks support to ReactShallowRenderer (facebook#14567) //<Dominic Gannaway>//
- **[1454a8be0](facebook/react@1454a8be0 )**: Don't bother comparing constructor when deps are not provided (facebook#14594) //<Andrew Clark>//
- **[71b64d521](facebook/react@71b64d521 )**: Warn if number of hooks increases (facebook#14591) //<Andrew Clark>//
- **[790c8ef04](facebook/react@790c8ef04 )**: Allow useReducer to bail out of rendering by returning previous state (facebook#14569) //<Andrew Clark>//
- **[7ab8a8e97](facebook/react@7ab8a8e97 )**: Added Flow type to keep hooks dispatchers in-sync (facebook#14599) //<Brian Vaughn>//
- **[4392e3821](facebook/react@4392e3821 )**: useDebugValue should throw if used in a class component (facebook#14601) //<Brian Vaughn>//
- **[153a0b598](facebook/react@153a0b598 )**: Add noop useDebugValue hook to partial/server renderer (facebook#14597) //<Brian Vaughn>//
- **[7ad9806d1](facebook/react@7ad9806d1 )**: Tweak to avoid property read (facebook#14593) //<Brandon Dail>//
- **[0fc154751](facebook/react@0fc154751 )**: Avoid new Set([iterable]) for thenables (facebook#14592) //<Brandon Dail>//
- **[edb1f5956](facebook/react@edb1f5956 )**: Support configurable labels for custom hooks (facebook#14559) //<Brian Vaughn>//
- **[3e15b1c69](facebook/react@3e15b1c69 )**: make a fork for ReactCurrentDispatcher (facebook#14588) //<Sunil Pai>//
- **[0005d1e3f](facebook/react@0005d1e3f )**: Fix typo (facebook#14576) //<Carl Mungazi>//
- **[f290138d3](facebook/react@f290138d3 )**: react-debug-tools accepts currentDispatcher ref as param (facebook#14556) //<Brian Vaughn>//
- **[b4ad8e947](facebook/react@b4ad8e947 )**: rename useImperativeMethods -> useImperativeHandle (facebook#14565) //<Sunil Pai>//
- **[ab03e3d65](facebook/react@ab03e3d65 )**: Inject ReactCurrentDispatcher ref to DevTools (facebook#14550) //<Brian Vaughn>//
- **[19ef0ec11](facebook/react@19ef0ec11 )**: Separate current owner and dispatcher (facebook#14548) //<Brian Vaughn>//
- **[a9b035b0c](facebook/react@a9b035b0c )**: Separate Object.is polyfill (facebook#14334) //<Maksim Markelov>//
- **[547e059f0](facebook/react@547e059f0 )**: Simplify wording of key warning (facebook#14503) //<Sophie Alpert>//
- **[3494ee57e](facebook/react@3494ee57e )**: Update ReactUpdateQueue.js (facebook#14521) //<Carl Mungazi>//
- **[659c13963](facebook/react@659c13963 )**: Update ReactFiberScheduler.js (facebook#14477) //<Carl Mungazi>//
- **[c695b2384](facebook/react@c695b2384 )**: React v16.7.0 //<Andrew Clark>//
- **[1c5aa2f23](facebook/react@1c5aa2f23 )**: Move SchedulerFeatureFlags fork to src directory to fix lint //<Andrew Clark>//
- **[653bc582f](facebook/react@653bc582f )**: Create separate SchedulerFeatureFlags instead of using ReactFeatureFlags (facebook#14455) //<Andrew Clark>//
- **[8bfef0da5](facebook/react@8bfef0da5 )**: Make scheduler debugging feature flag static //<Andrew Clark>//
- **[4a1072194](facebook/react@4a1072194 )**: Memoize promise listeners to prevent exponential growth (facebook#14429) //<Andrew Clark>//
- **[535804f5c](facebook/react@535804f5c )**: Removed Fabric-specific feature flag files and updated Rollup to use the (non-Fabric) React Native flag files. (facebook#14437) //<Brian Vaughn>//
- **[2743fb7b2](facebook/react@2743fb7b2 )**: Enable hooks by default for FB React Native renderer (facebook#14435) //<Brian Vaughn>//
- **[7325ebe4d](facebook/react@7325ebe4d )**: Inject overrideProps() fn to DevTools (facebook#14427) //<Brian Vaughn>//
- **[a22880e5e](facebook/react@a22880e5e )**: Add support for Suspense & lazy() to the react-is package (facebook#14423) //<Pleun Vanderbauwhede>//
- **[947bddd5c](facebook/react@947bddd5c )**: Remove redundant argument of getPlugins function (facebook#14419) //<Heaven>//
- **[8df4d59be](facebook/react@8df4d59be )**: Implement pauseExecution, continueExecution, dumpQueue for Scheduler (facebook#14053) //<Kevin Chavez>//
- **[5bb4ad737](facebook/react@5bb4ad737 )**: Added ErrorBoundary tests for useEffect and useLayoutEffect (facebook#14401) //<Brian Vaughn>//
- **[98eb5ae53](facebook/react@98eb5ae53 )**: TestRenderer toJSON should not expose the Array wrapper Suspense uses for hidden trees (facebook#14392) //<Brian Vaughn>//
- **[39489e767](facebook/react@39489e767 )**: Enable hooks in fabric (facebook#14301) //<Spencer Ahrens>//
- **[1dc108e58](facebook/react@1dc108e58 )**: Tweaked wording for v8 "performance cliff" issue //<Brian Vaughn>//

Release Notes:
[GENERAL] [Changed] - React sync for revisions 6bf5e85...aa94237 (React 16.8.1)

Pull Request resolved: facebook#23320

Differential Revision: D13976467

fbshipit-source-id: 9e11552268883db8672d11cf489d3a5949f498b7
facebook-github-bot pushed a commit that referenced this pull request Feb 8, 2019
Summary:
allow-large-files

This sync includes the following changes:
- **[45fc46bfa](facebook/react@45fc46bfa )**: 16.8.1 packages //<Brian Vaughn>//
- **[f2e2637c8](facebook/react@f2e2637c8 )**: Backwards compat fix for ReactCurrentDispatcher on older react versions (#14770) //<Brian Vaughn>//
- **[1107b9673](facebook/react@1107b9673 )**: [TestUtils.act] warn when using TestUtils.act in node (#14768) //<Sunil Pai>//
- **[0975ea327](facebook/react@0975ea327 )**: eslint-plugin-react-hooks v1.0.0 //<Brian Vaughn>//
- **[bc9818f24](facebook/react@bc9818f24 )**: Scheduler.unstable_next (#14756) //<Andrew Clark>//
- **[ce6ecd3fb](facebook/react@ce6ecd3fb )**: Add 16.8.0 changelog and update some READMEs (#14692) //<Dan Abramov>//
- **[008a2ab9c](facebook/react@008a2ab9c )**: 16.8.0 //<Brian Vaughn>//
- **[d1326f466](facebook/react@d1326f466 )**: [TestUtils.act] fix return result checking  (#14758) //<Sunil Pai>//
- **[267ed9814](facebook/react@267ed9814 )**: expose `TestUtils.act()` for batching actions in tests (#14744) //<Sunil Pai>//
- **[fb3f7bfde](facebook/react@fb3f7bfde )**: Avoid importing Scheduler directly (#14757) //<Andrew Clark>//
- **[e602b5291](facebook/react@e602b5291 )**: Use SameValue instead of === to check for dispatchAction equivalence (#14752) //<Jessica Franco>//
- **[e489c3f9c](facebook/react@e489c3f9c )**: Update the version with Hooks proposal in README (#14751) //<SToneX>//
- **[c21c41ecf](facebook/react@c21c41ecf )**: Tweak invalid Hook warning and error (#14747) //<Dan Abramov>//
- **[fec00a869](facebook/react@fec00a869 )**: Typo in comment (#14739) //<Deniz Susman>//
- **[66eb29374](facebook/react@66eb29374 )**: Restrict effect return type to a function or nothing (#14119) //<Andrew Clark>//
- **[51c07912a](facebook/react@51c07912a )**: Warn when second argument is passed to useCallback (#14729) //<Dan Abramov>//
- **[70d407583](facebook/react@70d407583 )**: Move Hook mismatch warning to first mismatch site (#14720) //<Andrew Clark>//
- **[ba6477aa3](facebook/react@ba6477aa3 )**: Improve Reducer Hook's lazy init API (#14723) //<Andrew Clark>//
- **[cb1ff430e](facebook/react@cb1ff430e )**: Phased dispatcher (#14701) //<Andrew Clark>//
- **[9d483dcfd](facebook/react@9d483dcfd )**: Spelling abitrarily -> arbitrarily (#14710) //<Peter Donald>//
- **[e19c9e106](facebook/react@e19c9e106 )**: Fix issue with multiple code branches in hooks linter (#14661) //<Yurick>//
- **[f11a9c1cb](facebook/react@f11a9c1cb )**: State update bug in concurrent mode (#14698) //<Brian Vaughn>//
- **[e679a4b6e](facebook/react@e679a4b6e )**: Fix typo in code comment (#14696) //<Greg Hurrell>//
- **[8bcc88f2e](facebook/react@8bcc88f2e )**: Make all readContext() and Hook-in-a-Hook checks DEV-only (#14677) //<Dan Abramov>//
- **[6cb26774e](facebook/react@6cb26774e )**: Enable hooks! (#14679) //<Brian Vaughn>//
- **[73962c366](facebook/react@73962c366 )**: Revert "Revert "Double-render function components with Hooks in DEV in StrictMode" (#14652)" (#14654) //<Dan Abramov>//
- **[994439228](facebook/react@994439228 )**: Put DEV-only code into DEV blocks (#14673) //<Dan Abramov>//
- **[f0befae65](facebook/react@f0befae65 )**: Tweak context invariant message (#14671) //<Dan Abramov>//
- **[a129259ad](facebook/react@a129259ad )**: Disallow reading context during useMemo etc (#14653) //<Dan Abramov>//
- **[c068d31cc](facebook/react@c068d31cc )**: Add unit tests for concurrent mode event dispatching (#14415) //<Sebastian Markbåge>//
- **[38247cba3](facebook/react@38247cba3 )**: --save is no longer needed (#14302) //<SamCortopassi>//
- **[3f0bcaf0d](facebook/react@3f0bcaf0d )**: Importing React for the first example. (#14346) //<Ramón Chancay Ortega>//
- **[ecd919a2f](facebook/react@ecd919a2f )**: RFC: warn when returning different hooks on subsequent renders (#14585) //<Sunil Pai>//
- **[3fbebb2a0](facebook/react@3fbebb2a0 )**: Revert "Double-render function components with Hooks in DEV in StrictMode" (#14652) //<Dan Abramov>//
- **[5fce6488c](facebook/react@5fce6488c )**: Revert "Disallow reading context during useMemo etc" (#14651) //<Dan Abramov>//
- **[fe2ecd276](facebook/react@fe2ecd276 )**: Add test coverage for readContext() on the server (#14649) //<Dan Abramov>//
- **[8f45a7fdc](facebook/react@8f45a7fdc )**: Warn about incorrect use of useImperativeHandle() (#14647) //<Dan Abramov>//
- **[1fcbd2243](facebook/react@1fcbd2243 )**: Disallow reading context during useMemo etc (#14648) //<Dan Abramov>//
- **[2a084f51a](facebook/react@2a084f51a )**: Warn about refs on lazy function components (#14645) //<Dan Abramov>//
- **[b5a3df6e8](facebook/react@b5a3df6e8 )**: Fix typo (#14560) //<Linchengyi>//
- **[9c146e675](facebook/react@9c146e675 )**: fix typo (#14316) //<liunian>//
- **[baa6d40fc](facebook/react@baa6d40fc )**: Mention forwardRef() in <Fn ref={...} /> errors and warnings (#14644) //<Dan Abramov>//
- **[a1414e894](facebook/react@a1414e894 )**: Double-render function components with Hooks in DEV in StrictMode (#14643) //<Dan Abramov>//
- **[10a7a5b5c](facebook/react@10a7a5b5c )**: Fix synchronous thenable rejection (#14633) //<Dan Abramov>//
- **[a2fa6eb98](facebook/react@a2fa6eb98 )**: Move lazy._result assignment (#14632) //<Dan Abramov>//
- **[9120f6c2d](facebook/react@9120f6c2d )**: Support sync thenables for lazy() (#14626) //<Dan Abramov>//
- **[b66e6e41e](facebook/react@b66e6e41e )**: Add directory details to the package.json of all packages (#14628) //<Grey Baker>//
- **[177fb7635](facebook/react@177fb7635 )**: Warn when second callback is passed to setState/dispatch in Hooks (#14625) //<Dan Abramov>//
- **[d17d0b99c](facebook/react@d17d0b99c )**: Use public context.report interface in eslint rules (#14623) //<Sebastian Silbermann>//
- **[4f332885a](facebook/react@4f332885a )**: Fix shallow renderer set instance state after gDSFP before calling sCU (#14613) //<Yi-Shan, Chen>//
- **[e1cd83e49](facebook/react@e1cd83e49 )**: Throw an error when using hooks inside useMemo/useState/useReducer, or .memo's comparator (#14608) //<Sunil Pai>//
- **[be457ca68](facebook/react@be457ca68 )**: Small tweaks to SSR to match #14594 (#14618) //<Dan Abramov>//
- **[17d70df91](facebook/react@17d70df91 )**: Warn when mixing createRoot() and old APIs (#14615) //<Dan Abramov>//
- **[4feab7fc9](facebook/react@4feab7fc9 )**: Add hooks support to ReactShallowRenderer (#14567) //<Dominic Gannaway>//
- **[1454a8be0](facebook/react@1454a8be0 )**: Don't bother comparing constructor when deps are not provided (#14594) //<Andrew Clark>//
- **[71b64d521](facebook/react@71b64d521 )**: Warn if number of hooks increases (#14591) //<Andrew Clark>//
- **[790c8ef04](facebook/react@790c8ef04 )**: Allow useReducer to bail out of rendering by returning previous state (#14569) //<Andrew Clark>//
- **[7ab8a8e97](facebook/react@7ab8a8e97 )**: Added Flow type to keep hooks dispatchers in-sync (#14599) //<Brian Vaughn>//
- **[4392e3821](facebook/react@4392e3821 )**: useDebugValue should throw if used in a class component (#14601) //<Brian Vaughn>//
- **[153a0b598](facebook/react@153a0b598 )**: Add noop useDebugValue hook to partial/server renderer (#14597) //<Brian Vaughn>//
- **[7ad9806d1](facebook/react@7ad9806d1 )**: Tweak to avoid property read (#14593) //<Brandon Dail>//
- **[0fc154751](facebook/react@0fc154751 )**: Avoid new Set([iterable]) for thenables (#14592) //<Brandon Dail>//
- **[edb1f5956](facebook/react@edb1f5956 )**: Support configurable labels for custom hooks (#14559) //<Brian Vaughn>//
- **[3e15b1c69](facebook/react@3e15b1c69 )**: make a fork for ReactCurrentDispatcher (#14588) //<Sunil Pai>//
- **[0005d1e3f](facebook/react@0005d1e3f )**: Fix typo (#14576) //<Carl Mungazi>//
- **[f290138d3](facebook/react@f290138d3 )**: react-debug-tools accepts currentDispatcher ref as param (#14556) //<Brian Vaughn>//
- **[b4ad8e947](facebook/react@b4ad8e947 )**: rename useImperativeMethods -> useImperativeHandle (#14565) //<Sunil Pai>//
- **[ab03e3d65](facebook/react@ab03e3d65 )**: Inject ReactCurrentDispatcher ref to DevTools (#14550) //<Brian Vaughn>//
- **[19ef0ec11](facebook/react@19ef0ec11 )**: Separate current owner and dispatcher (#14548) //<Brian Vaughn>//
- **[a9b035b0c](facebook/react@a9b035b0c )**: Separate Object.is polyfill (#14334) //<Maksim Markelov>//
- **[547e059f0](facebook/react@547e059f0 )**: Simplify wording of key warning (#14503) //<Sophie Alpert>//
- **[3494ee57e](facebook/react@3494ee57e )**: Update ReactUpdateQueue.js (#14521) //<Carl Mungazi>//
- **[659c13963](facebook/react@659c13963 )**: Update ReactFiberScheduler.js (#14477) //<Carl Mungazi>//
- **[c695b2384](facebook/react@c695b2384 )**: React v16.7.0 //<Andrew Clark>//
- **[1c5aa2f23](facebook/react@1c5aa2f23 )**: Move SchedulerFeatureFlags fork to src directory to fix lint //<Andrew Clark>//
- **[653bc582f](facebook/react@653bc582f )**: Create separate SchedulerFeatureFlags instead of using ReactFeatureFlags (#14455) //<Andrew Clark>//
- **[8bfef0da5](facebook/react@8bfef0da5 )**: Make scheduler debugging feature flag static //<Andrew Clark>//
- **[4a1072194](facebook/react@4a1072194 )**: Memoize promise listeners to prevent exponential growth (#14429) //<Andrew Clark>//
- **[535804f5c](facebook/react@535804f5c )**: Removed Fabric-specific feature flag files and updated Rollup to use the (non-Fabric) React Native flag files. (#14437) //<Brian Vaughn>//
- **[2743fb7b2](facebook/react@2743fb7b2 )**: Enable hooks by default for FB React Native renderer (#14435) //<Brian Vaughn>//
- **[7325ebe4d](facebook/react@7325ebe4d )**: Inject overrideProps() fn to DevTools (#14427) //<Brian Vaughn>//
- **[a22880e5e](facebook/react@a22880e5e )**: Add support for Suspense & lazy() to the react-is package (#14423) //<Pleun Vanderbauwhede>//
- **[947bddd5c](facebook/react@947bddd5c )**: Remove redundant argument of getPlugins function (#14419) //<Heaven>//
- **[8df4d59be](facebook/react@8df4d59be )**: Implement pauseExecution, continueExecution, dumpQueue for Scheduler (#14053) //<Kevin Chavez>//
- **[5bb4ad737](facebook/react@5bb4ad737 )**: Added ErrorBoundary tests for useEffect and useLayoutEffect (#14401) //<Brian Vaughn>//
- **[98eb5ae53](facebook/react@98eb5ae53 )**: TestRenderer toJSON should not expose the Array wrapper Suspense uses for hidden trees (#14392) //<Brian Vaughn>//
- **[39489e767](facebook/react@39489e767 )**: Enable hooks in fabric (#14301) //<Spencer Ahrens>//
- **[1dc108e58](facebook/react@1dc108e58 )**: Tweaked wording for v8 "performance cliff" issue //<Brian Vaughn>//

Release Notes:
[GENERAL] [Changed] - React sync for revisions 6bf5e85...aa94237 (React 16.8.1)

Pull Request resolved: #23320

Reviewed By: rickhanlonii

Differential Revision: D13976467

fbshipit-source-id: 4ce198e86a54658e1c35aa36bffe4a7dc2956a2e
@vision72
Copy link

Hi @joshjhargreaves, I hope you are doing well.
The onKeyPress Android is an amazing implementation, and I have been using it since as soon as it was launched, as many other developers do.

There is one issue with the onKeyPress property, which I am looking at, and I wanted to know more about the implementation of the event.preventDefault prototype of the SyntheticEvent class.

What I found out was there is a ReactEditTextInputConnectionWrapper class that extends the InputConnectionWrapper class which generates a key press native event and updates the input text, basically adding text on the input field.

I wanted to know in scenarios of using the event.preventDefault or event.stopPropagation from the event object of the onKeyPress property, can the setComposingText function from the ReactEditTextInputConnectionWrapper class handle a similar condition as,

boolean cursorMovedBackwardsOrAtBeginningOfInput =
        (currentSelectionStart < previousSelectionStart) || currentSelectionStart <= 0; 

Where we specify that the preventDefault will not initiate a dispatchKeyEventOrEnqueue, which indirectly overwrites the bubbling of the input key, thereby achieving an event.stopPropagation behavior.

Now, I have yet to check out your PR raised with the onKeyPress property, it could be that it's working in the earlier versions and not now.

I will keep you posted, and await your inputs on the preventDefault/stopPropagation events.

Link to the Issue: #38155.
CC: @cortinico

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Import Started This pull request has been imported. This does not imply the PR has been approved.
Projects
None yet
Development

Successfully merging this pull request may close these issues.