From c30ff1e39b9fca747198c028a33300656a90e612 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Tue, 11 Aug 2020 13:29:36 +0100 Subject: [PATCH] Add onFocusIn note --- content/blog/2020-08-10-react-v17-rc.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/content/blog/2020-08-10-react-v17-rc.md b/content/blog/2020-08-10-react-v17-rc.md index 2b0df2bd..f0c72d6e 100644 --- a/content/blog/2020-08-10-react-v17-rc.md +++ b/content/blog/2020-08-10-react-v17-rc.md @@ -123,6 +123,10 @@ We've made a couple of smaller changes related to the event system: These changes align React closer with the browser behavior and improve interoperability. +>Note +> +>Although React 17 switched from `focus` to `focusin` *under the hood* for the `onFocus` event, note that this has **not** affected the bubbling behavior. In React, `onFocus` event has always bubbled, and it continues to do so in React 17 because generally it is a more useful default. See [this sandbox](https://codesandbox.io/s/strange-albattani-7tqr7?file=/src/App.js) for the different checks you can add for different particular use cases. + ### No Event Pooling {#no-event-pooling} React 17 removes the "event pooling" optimization from React. It doesn't improve performance in modern browsers and confuses even experienced React users: