From 680e467576c78855448afe4f67423682471bba02 Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Sun, 28 Aug 2022 13:58:47 +0100 Subject: [PATCH] fix: moving the Using forwardRef and Using a getter to a lower hierarchy level --- docs/new-architecture-library-intro.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/new-architecture-library-intro.md b/docs/new-architecture-library-intro.md index fab1bbe4bb6..b0eaaca055a 100644 --- a/docs/new-architecture-library-intro.md +++ b/docs/new-architecture-library-intro.md @@ -277,7 +277,7 @@ We can’t convert this call to `this._ref.measure` because `this._ref` is an in `ChildComponent` renders a `View`, which is a HostComponent, so we need to get a reference to `View` instead. There are typically two approaches to get what we need. If the component we need to get the ref from is a function component using `forwardRef` is probably the right choice. If it is a class component with other public methods, adding a public method for getting the ref is an option. Here are examples of those two forms: -### Using `forwardRef` +#### Using `forwardRef` ```jsx class ParentComponent extends React.Component { @@ -307,7 +307,7 @@ const ChildComponent = React.forwardRef((props, forwardedRef) => { }); ``` -### Using a getter, (note the addition of `getViewRef`) +#### Using a getter, (note the addition of `getViewRef`) ```tsx class ParentComponent extends React.Component {