From 523a865d879e42fdf93a8142d063a08e4abf9972 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Mar 2019 15:38:11 +0100 Subject: [PATCH 1/2] [docs] Include `innerRef` breaking change in changelog --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a039633eb8b4b..447fccfe57ee5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,13 @@ Here are some highlights ✨: + ``` +- Every component except `Dialog`, `MenuList`, `Modal`, `Popover` and `Tabs` forward + their `innerRef` (#14536). + + `innerRef` will no longer return a ref to the instance + (or nothing if the inner component is a function component) but a ref to its root component. + The corresponding API docs list the root component. + ### Changes - [core] Improve a11y for Collapse, ExpansionPanel and Grow (#14598) @eps1lon From 024d66885350b5ed70b4f0d641401e2ee4792654 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 6 Mar 2019 15:46:56 +0100 Subject: [PATCH 2/2] include possible breakage --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 447fccfe57ee5d..6477361b467781 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,8 @@ Here are some highlights ✨: - Every component except `Dialog`, `MenuList`, `Modal`, `Popover` and `Tabs` forward their `innerRef` (#14536). + This is implemented by using `React.forwardRef`. This affects the internal component + tree and display name and therefore might break shallow or snapshot tests. `innerRef` will no longer return a ref to the instance (or nothing if the inner component is a function component) but a ref to its root component. The corresponding API docs list the root component.