Skip to content

Commit 1010df9

Browse files
Roeeflbrentvatne
authored andcommitted
import withNavigation removed from button component (react-navigation#352)
* import withNavigation removed from button component import { withNavigation } from 'react-navigation'; (Suggested) to be removed from first code example to make it more clear to newcomers that it can be used as one approach to receive the navigation prop. * Update connecting-navigation-prop.md
1 parent 0d5f641 commit 1010df9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/connecting-navigation-prop.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ sidebar_label: Access the navigation prop from any component
66

77
[`withNavigation`](with-navigation.html) is a higher order component which passes the `navigation` prop into a wrapped Component. It's useful when you cannot pass the `navigation` prop into the component directly, or don't want to pass it in case of a deeply nested child.
88

9+
10+
An ordinary component that is not a screen component will not receive the navigation prop by default, for example in this `MyBackButton` component:
11+
912
```javascript
1013
import React from 'react';
1114
import { Button } from 'react-native';
12-
import { withNavigation } from 'react-navigation';
1315

1416
export default class MyBackButton extends React.Component {
1517
render() {

0 commit comments

Comments
 (0)