Skip to content

Commit 96f1bde

Browse files
committed
update link
1 parent e3ad197 commit 96f1bde

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

website/versioned_docs/version-3.x/action-after-focusing-screen.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@ sidebar_label: Action After Focusing Screen
55
original_id: action-after-focusing-screen
66
---
77

8-
In this guide, we will call an action on screen focusing. This is useful for making additional API calls when a user visits a particular screen in a Tab Navigator, or to track user events as they tap around our app.
8+
In this guide we will call an action on screen focusing. This is useful for making additional API calls when a user revisits a particular screen in a Tab Navigator, or to track user events as they tap around our app.
99

1010
There are two approaches to calling an action on screen focusing:
1111

1212
1. Using the `withNavigationFocus` higher order component provided by react-navigation.
1313
2. Listening to the `'didFocus'` event with an event listener.
1414

15-
## Triggering an action with a higher order component
15+
## Triggering an action with the `withNavigationFocus` higher order component
1616

17-
react-navigation provides a [higher order component](https://reactjs.org/docs/higher-order-components.html) that passes a `isFocused` to our component, along with the `navigation` object we'd normally get with `withNavigation`.
17+
react-navigation provides a [higher order component](https://reactjs.org/docs/higher-order-components.html) that passes an `isFocused` prop to our component, along with the `navigation` object we'd normally get with `withNavigation`.
1818

19-
When the prop `isFocused` is passed to our component, it will pass `true` when the screen is focused and `false` when our component is no longer focused. This enables us to call functions on a user entering or leaving a screen.
19+
When the `isFocused` prop is passed to our component, it will pass `true` when the screen is focused and `false` when our component is no longer focused. This enables us to call actions on a user entering or leaving a screen.
2020

2121
### Example
2222

@@ -43,9 +43,9 @@ class TabScreen extends Component {
4343
export default withNavigationFocus(TabScreen);
4444
```
4545

46-
This example is also documented in the `withNavigationFocus` API documentation.
46+
This example is also documented in the <a href="/docs/en/with-navigation-focus.html">`withNavigationFocus` API documentation</a>.
4747

48-
## Triggering an action with an event listener
48+
## Triggering an action with a `'didFocus'` event listener
4949

5050
We can also listen to the `'didFocus'` event with an event listener. After setting up an event listener, we must also stop listening to the event when the screen is unmounted.
5151

0 commit comments

Comments
 (0)