Skip to content

Commit 7acc650

Browse files
lex111satya164
authored andcommitted
1 parent 3ad8dd5 commit 7acc650

34 files changed

+52
-47
lines changed

docs/compatibility.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Due to the dynamic API of React Navigation 5, some functionality possible with t
7171

7272
- It only wraps the core API, not navigator's API. This basically means that the options you're passing to a navigator might be a bit different.
7373
- Legacy deep link support by defining `path` in route configuration is not supported.
74-
- Navigating to a navigator doesn't work the same, i.e. we can't navigate to a screen in a navigator that's not rendered already, and params are't merged.
74+
- Navigating to a navigator doesn't work the same, i.e. we can't navigate to a screen in a navigator that's not rendered already, and params aren't merged.
7575
- Some methods such as the legacy `reset` method which take an array of actions isn't supported anymore. Unsupported methods will throw errors when using them as well as give type errors if we're using TypeScript.
7676
- It doesn't export `createAppContainer`, so you'll need to use the v5 API for the container (`NavigationNativeContainer`). This also means any features supported by the container need to be migrated to the new API.
7777

docs/contributing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,4 +154,4 @@ It's useful to run tests in watch mode when working on the project. To do it, ru
154154
yarn test --watch
155155
```
156156

157-
These commands will be run by our CI and are required to pass before any contributtions are merged.
157+
These commands will be run by our CI and are required to pass before any contributions are merged.

docs/custom-android-back-button-handling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sidebar_label: Custom Android back button behavior
66

77
By default, when user presses the Android hardware back button, react-navigation will pop a screen or exit the app if there are no screens to pop. This is a sensible default behavior, but there are situations when you might want to implement custom handling.
88

9-
As an example, consider a screen where user is selecting items in a list, and a "selection mode" is active. On a back button press, you would first want the "selection mode" to be deactivated, and the screen should be popped only on the second back button press. The following code snippet demostrates the situation. We make use of [`BackHandler`](https://facebook.github.io/react-native/docs/backhandler.html) which comes with react-native along with the `useFocusEffect` hook to add our custom `hardwareBackPress` listener.
9+
As an example, consider a screen where user is selecting items in a list, and a "selection mode" is active. On a back button press, you would first want the "selection mode" to be deactivated, and the screen should be popped only on the second back button press. The following code snippet demonstrates the situation. We make use of [`BackHandler`](https://facebook.github.io/react-native/docs/backhandler.html) which comes with react-native along with the `useFocusEffect` hook to add our custom `hardwareBackPress` listener.
1010

1111
Returning `true` from `onBackPress` denotes that we have handled the event, and react-navigation's listener will not get called, thus not popping the screen. Returning `false` will cause the event to bubble up and react-navigation's listener will pop the screen.
1212

docs/custom-navigators.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ Under the hood, navigators are plain React components.
1212

1313
We include some commonly needed navigators such as:
1414

15-
- [createStackNavigator](stack-navigator.html) - Renders one screen at a time and provides transitions between screens. When a new screen is opened it is placed on top of the stack.
16-
- [createDrawerNavigator](drawer-navigator.html) - Provides a drawer that slides in from the left of the screen.
17-
- [createBottomTabNavigator](bottom-tab-navigator.html) - Renders a tab bar that lets the user switch between several screens.
18-
- [createMaterialTopTabNavigator](material-top-tab-navigator.html) - Renders tab view which lets the user switch between several screens using swipe gesture or the tab bar.
19-
- [createMaterialBottomTabNavigator](material-bottom-tab-navigator.html) - Renders tab view which lets the user switch between several screens using swipe gesture or the tab bar.
15+
- [`createStackNavigator`](stack-navigator.html) - Renders one screen at a time and provides transitions between screens. When a new screen is opened it is placed on top of the stack.
16+
- [`createDrawerNavigator`](drawer-navigator.html) - Provides a drawer that slides in from the left of the screen.
17+
- [`createBottomTabNavigator`](bottom-tab-navigator.html) - Renders a tab bar that lets the user switch between several screens.
18+
- [`createMaterialTopTabNavigator`](material-top-tab-navigator.html) - Renders tab view which lets the user switch between several screens using swipe gesture or the tab bar.
19+
- [`createMaterialBottomTabNavigator`](material-bottom-tab-navigator.html) - Renders tab view which lets the user switch between several screens using swipe gesture or the tab bar.
2020

2121
## Extending Navigators
2222

docs/drawer-based-navigation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function MyNotificationsScreen({ navigation }) {
3636
);
3737
}
3838

39-
exprt default function App() {
39+
export default function App() {
4040
return (
4141
<NavigationNativeContainer>
4242
<Drawer.Navigator initialRouteName="Feed">

docs/getting-started.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,12 @@ Install the required packages in your React Native project.
2020

2121
```bash
2222
yarn add @react-navigation/core@next @react-navigation/native@next
23-
# or with npm
24-
# npm install @react-navigation/core@next @react-navigation/native@next
23+
```
24+
25+
Or with npm
26+
27+
```sh
28+
npm install @react-navigation/core@next @react-navigation/native@next
2529
```
2630

2731
When you use a navigator, you'll need to follow the installation instructions of that navigator for any additional configuration.

docs/glossary-of-terms.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ A screen component is a component that we use in our route configuration.
1717
```js
1818
const Stack = createStackNavigator();
1919

20-
const StactNavigator = (
20+
const StackNavigator = (
2121
<Stack.Navigator>
2222
<Stack.Screen
2323
name="Home"

docs/headers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ function StackScreen() {
163163
164164
## Additional configuration
165165
166-
You can read the full list of available `options` for screens inside of a stack navigator in the [createStackNavigator reference](stack-navigator.html#navigationoptions-used-by-stacknavigator).
166+
You can read the full list of available `options` for screens inside of a stack navigator in the [`createStackNavigator` reference](stack-navigator.html#navigationoptions-used-by-stacknavigator).
167167
168168
## Summary
169169

docs/stack-actions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: StackActions reference
44
sidebar_label: StackActions
55
---
66

7-
`StackActions` is an object containing methods for generating actions specific to stack-based navigators. Its methods expand upon the actions available in [NavigationActions](navigation-actions.html).
7+
`StackActions` is an object containing methods for generating actions specific to stack-based navigators. Its methods expand upon the actions available in [`NavigationActions`](navigation-actions.html).
88

99
The following actions are supported:
1010

docs/tab-actions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: TabActions reference
44
sidebar_label: TabActions
55
---
66

7-
`TabActions` is an object containing methods for generating actions specific to tab-based navigators. Its methods expand upon the actions available in [NavigationActions](navigation-actions.html).
7+
`TabActions` is an object containing methods for generating actions specific to tab-based navigators. Its methods expand upon the actions available in [`NavigationActions`](navigation-actions.html).
88

99
The following actions are supported:
1010

docs/tab-based-navigation.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sidebar_label: Tab navigation
66

77
Possibly the most common style of navigation in mobile apps is tab-based navigation. This can be tabs on the bottom of the screen or on the top below the header (or even instead of a header).
88

9-
This guide covers [createBottomTabNavigator](bottom-tab-navigator.html). You may also use [createMaterialBottomTabNavigator](material-bottom-tab-navigator.html) and [createMaterialTopTabNavigator](material-top-tab-navigator.html) to add tabs to your application.
9+
This guide covers [`createBottomTabNavigator`](bottom-tab-navigator.html). You may also use [`createMaterialBottomTabNavigator`](material-bottom-tab-navigator.html) and [`createMaterialTopTabNavigator`](material-top-tab-navigator.html) to add tabs to your application.
1010

1111
## Minimal example of tab-based navigation
1212

@@ -115,7 +115,7 @@ export default function IconWithBadge({
115115
{badgeCount > 0 && (
116116
<View
117117
style={{
118-
// On react-native < 0.57 overflow outside of parent will not work on Android, see https://git.io/fhLJ8
118+
// On React Native < 0.57 overflow outside of parent will not work on Android, see https://git.io/fhLJ8
119119
position: 'absolute',
120120
right: -6,
121121
top: -3,
@@ -137,11 +137,11 @@ export default function IconWithBadge({
137137
}
138138
```
139139

140-
From UI perspective this component is ready to use, but you still need to find some way to pass down the badge count properly from somewhere else, like using [React Context](https://reactjs.org/docs/context.html), [redux](https://redux.js.org/), [mobx](https://mobx.js.org/) or [event emitters](https://github.com/facebook/react-native/blob/master/Libraries/vendor/emitter/EventEmitter.js).
140+
From UI perspective this component is ready to use, but you still need to find some way to pass down the badge count properly from somewhere else, like using [React Context](https://reactjs.org/docs/context.html), [Redux](https://redux.js.org/), [MobX](https://mobx.js.org/) or [event emitters](https://github.com/facebook/react-native/blob/master/Libraries/vendor/emitter/EventEmitter.js).
141141

142142
```js
143143
export default function HomeIconWithBadge(props) {
144-
// You should pass down the badgeCount in some other ways like react context api, redux, mobx or event emitters.
144+
// You should pass down the badgeCount in some other ways like React Context API, Redux, MobX or event emitters.
145145
return <IconWithBadge {...props} badgeCount={3} />;
146146
}
147147
```

docs/use-scroll-to-top.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ sidebar_label: useScrollToTop
66

77
The expected native behavior of scrollable components is to to respond to events from navigation that will scroll to top when tapping on the active tab as you would expect from native tab bars.
88

9-
In order to achieve it we export `useScrollToTop` which accept ref to scrollable component (e,g. `ScrollView` or `FlatList`)
10-
Example
9+
In order to achieve it we export `useScrollToTop` which accept ref to scrollable component (e,g. `ScrollView` or `FlatList`).
10+
11+
Example:
1112

1213
```js
1314
import * as React from 'react';

website/versioned_docs/version-1.x/contributing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,4 +178,4 @@ React Navigation has tests implemented in [Jest](https://facebook.github.io/jest
178178
yarn run jest
179179
```
180180

181-
These commands will be run by our CI and are required to pass before any contributtions are merged.
181+
These commands will be run by our CI and are required to pass before any contributions are merged.

website/versioned_docs/version-1.x/custom-android-back-button-handling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ original_id: custom-android-back-button-handling
77

88
By default, when user presses the Android hardware back button, react-navigation will pop a screen or exit the app if there are no screens to pop. This is a sensible default behavior, but there are situations when you might want to implement custom handling.
99

10-
Take, for example, a screen where user is selecting items in a list, and a "selection mode" is active. On a back button press, you would first want the "selection mode" to be deactivated, and the screen should be popped only on the second back button press. The following code snippet demostrates the situation. We make use of [`BackHandler`](https://facebook.github.io/react-native/docs/backhandler.html) which comes with react-native to add our custom `hardwareBackPress` listener.
10+
Take, for example, a screen where user is selecting items in a list, and a "selection mode" is active. On a back button press, you would first want the "selection mode" to be deactivated, and the screen should be popped only on the second back button press. The following code snippet demonstrates the situation. We make use of [`BackHandler`](https://facebook.github.io/react-native/docs/backhandler.html) which comes with react-native to add our custom `hardwareBackPress` listener.
1111

1212
Returning `true` from `onBackButtonPressAndroid` denotes that we have handled the event, and react-navigation's lister will not get called, thus not popping the screen. Returning `false` will cause the event to bubble up and react-navigation's listener will pop the screen.
1313

website/versioned_docs/version-2.x/contributing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,4 +174,4 @@ React Navigation has tests implemented in [Jest](https://facebook.github.io/jest
174174
yarn run jest
175175
```
176176

177-
These commands will be run by our CI and are required to pass before any contributtions are merged.
177+
These commands will be run by our CI and are required to pass before any contributions are merged.

website/versioned_docs/version-2.x/custom-android-back-button-handling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ By default, when user presses the Android hardware back button, react-navigation
99

1010
> If you're looking for an easy-to-use solution, you can check out a community-developed package [react-navigation-backhandler](https://github.com/vonovak/react-navigation-backhandler). The following text shows what the package does under the cover.
1111
12-
As an example, consider a screen where user is selecting items in a list, and a "selection mode" is active. On a back button press, you would first want the "selection mode" to be deactivated, and the screen should be popped only on the second back button press. The following code snippet demostrates the situation. We make use of [`BackHandler`](https://facebook.github.io/react-native/docs/backhandler.html) which comes with react-native and we [subscribe to navigation lifecycle updates](navigation-prop.html#addlistener-subscribe-to-updates-to-navigation-lifecycle) to add our custom `hardwareBackPress` listener.
12+
As an example, consider a screen where user is selecting items in a list, and a "selection mode" is active. On a back button press, you would first want the "selection mode" to be deactivated, and the screen should be popped only on the second back button press. The following code snippet demonstrates the situation. We make use of [`BackHandler`](https://facebook.github.io/react-native/docs/backhandler.html) which comes with react-native and we [subscribe to navigation lifecycle updates](navigation-prop.html#addlistener-subscribe-to-updates-to-navigation-lifecycle) to add our custom `hardwareBackPress` listener.
1313

1414
Returning `true` from `onBackButtonPressAndroid` denotes that we have handled the event, and react-navigation's listener will not get called, thus not popping the screen. Returning `false` will cause the event to bubble up and react-navigation's listener will pop the screen.
1515

website/versioned_docs/version-2.x/custom-navigator-overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Under the hood, navigators are plain React components.
1414
`react-navigation` includes some commonly needed navigators such as:
1515

1616
- [createStackNavigator](stack-navigator.html) - Renders one screen at a time and provides transitions between screens. When a new screen is opened it is placed on top of the stack.
17-
- [createBottomTabNavigator](bottom-tab-navigator.html) - Renders a tab bar that lets the user switch between several screens.
17+
- [`createBottomTabNavigator`](bottom-tab-navigator.html) - Renders a tab bar that lets the user switch between several screens.
1818
- [createSwitchNavigator](switch-navigator.html) - Switch between one screen and another with no UI on top of it, unmount screens when they become inactive.
1919
- [createDrawerNavigator](drawer-navigator.html) - Provides a drawer that slides in from the left of the screen.
2020

website/versioned_docs/version-2.x/drawer-actions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sidebar_label: DrawerActions
55
original_id: drawer-actions
66
---
77

8-
`DrawerActions` is an object containing methods for generating actions specific to drawer-based navigators. Its methods expand upon the actions available in [NavigationActions](navigation-actions.html).
8+
`DrawerActions` is an object containing methods for generating actions specific to drawer-based navigators. Its methods expand upon the actions available in [`NavigationActions`](navigation-actions.html).
99

1010
The following actions are supported:
1111
* [openDrawer](#openDrawer) - open the drawer

website/versioned_docs/version-2.x/headers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ class HomeScreen extends React.Component {
198198
199199
## Additional configuration
200200

201-
You can read the full list of available `navigationOptions` for screens inside of a stack navigator in the [createStackNavigator reference](stack-navigator.html#navigationoptions-used-by-stacknavigator).
201+
You can read the full list of available `navigationOptions` for screens inside of a stack navigator in the [`createStackNavigator` reference](stack-navigator.html#navigationoptions-used-by-stacknavigator).
202202

203203
## Summary
204204

website/versioned_docs/version-2.x/stack-actions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sidebar_label: StackActions
55
original_id: stack-actions
66
---
77

8-
`StackActions` is an object containing methods for generating actions specific to stack-based navigators. Its methods expand upon the actions available in [NavigationActions](navigation-actions.html).
8+
`StackActions` is an object containing methods for generating actions specific to stack-based navigators. Its methods expand upon the actions available in [`NavigationActions`](navigation-actions.html).
99

1010
The following actions are supported:
1111
* [Reset](#reset) - Replace current state with a new state

website/versioned_docs/version-2.x/tab-based-navigation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ original_id: tab-based-navigation
77

88
Possibly the most common style of navigation in mobile apps is tab-based navigation. This can be tabs on the bottom of the screen or on the top below the header (or even instead of a header).
99

10-
This guide covers [createBottomTabNavigator](bottom-tab-navigator.html). You may also use [createMaterialBottomTabNavigator](material-bottom-tab-navigator.html) and [createMaterialTopTabNavigator](material-top-tab-navigator.html) to add tabs to your application.
10+
This guide covers [`createBottomTabNavigator`](bottom-tab-navigator.html). You may also use [`createMaterialBottomTabNavigator`](material-bottom-tab-navigator.html) and [`createMaterialTopTabNavigator`](material-top-tab-navigator.html) to add tabs to your application.
1111

1212
## Minimal example of tab-based navigation
1313

website/versioned_docs/version-3.x/contributing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,4 +158,4 @@ React Navigation has tests implemented in [Jest](https://facebook.github.io/jest
158158
yarn run jest
159159
```
160160

161-
These commands will be run by our CI and are required to pass before any contributtions are merged.
161+
These commands will be run by our CI and are required to pass before any contributions are merged.

website/versioned_docs/version-3.x/custom-navigator-overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Under the hood, navigators are plain React components.
1414
`react-navigation` includes some commonly needed navigators such as:
1515

1616
- [createStackNavigator](stack-navigator.html) - Renders one screen at a time and provides transitions between screens. When a new screen is opened it is placed on top of the stack.
17-
- [createBottomTabNavigator](bottom-tab-navigator.html) - Renders a tab bar that lets the user switch between several screens.
17+
- [`createBottomTabNavigator`](bottom-tab-navigator.html) - Renders a tab bar that lets the user switch between several screens.
1818
- [createSwitchNavigator](switch-navigator.html) - Switch between one screen and another with no UI on top of it, unmount screens when they become inactive.
1919
- [createDrawerNavigator](drawer-navigator.html) - Provides a drawer that slides in from the left of the screen.
2020

website/versioned_docs/version-3.x/headers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ class HomeScreen extends React.Component {
224224
225225
## Additional configuration
226226

227-
You can read the full list of available `navigationOptions` for screens inside of a stack navigator in the [createStackNavigator reference](stack-navigator.html#navigationoptions-used-by-stacknavigator).
227+
You can read the full list of available `navigationOptions` for screens inside of a stack navigator in the [`createStackNavigator` reference](stack-navigator.html#navigationoptions-used-by-stacknavigator).
228228

229229
## Summary
230230

website/versioned_docs/version-3.x/switch-actions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sidebar_label: SwitchActions
55
original_id: switch-actions
66
---
77

8-
`SwitchActions` is an object containing methods for generating actions specific to switch-based navigators. Its methods expand upon the actions available in [NavigationActions](navigation-actions.html).
8+
`SwitchActions` is an object containing methods for generating actions specific to switch-based navigators. Its methods expand upon the actions available in [`NavigationActions`](navigation-actions.html).
99

1010
The following actions are supported:
1111

0 commit comments

Comments
 (0)