Skip to content

Commit f27f9de

Browse files
corehtimdorr
authored andcommitted
Update docs and example to use BackButton (remix-run#5513)
1 parent c5fb25d commit f27f9de

File tree

5 files changed

+31
-31
lines changed

5 files changed

+31
-31
lines changed

packages/react-router-native/docs/api/AndroidBackButton.md

Lines changed: 0 additions & 27 deletions
This file was deleted.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# <BackButton>
2+
3+
Connects the global back button on Android and tvOS to the router's history. On Android, when the initial location is reached, the default back behavior takes over. Just render one somewhere in your app.
4+
5+
```js
6+
<BackButton/>
7+
```
8+
9+
## children
10+
11+
If you want to avoid the floating configuration component, you can compose with children.
12+
13+
```js
14+
<NativeRouter>
15+
<BackButton>
16+
<App/>
17+
</BackButton>
18+
</NativeRouter>
19+
20+
// instead of
21+
<NativeRouter>
22+
<View>
23+
<BackButton/>
24+
<View>Some people don't like that.</View>
25+
</View>
26+
</NativeRouter>
27+
```

packages/react-router-native/index.android.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import React from 'react'
22
import { AppRegistry, StyleSheet, Text, View } from 'react-native'
33

4-
import { NativeRouter, Route, Link, DeepLinking, AndroidBackButton, Prompt } from './main'
4+
import { NativeRouter, Route, Link, DeepLinking, BackButton, Prompt } from './main'
55

66
export default class ReactRouterNative extends React.Component {
77
render() {
88
return (
99
<NativeRouter>
1010
<View style={styles.container}>
11-
<AndroidBackButton/>
11+
<BackButton/>
1212
<DeepLinking/>
1313

1414
<Route exact path="/" render={() => (

packages/react-router-website/modules/docs/Native.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export default {
22
api: [
3-
require('../../../react-router-native/docs/api/AndroidBackButton.md'),
3+
require('../../../react-router-native/docs/api/BackButton.md'),
44
require('../../../react-router-native/docs/api/DeepLinking.md'),
55
require('../../../react-router-native/docs/api/Link.md'),
66
require('../../../react-router-native/docs/api/NativeRouter.md'),

packages/react-router/docs/guides/Installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ All of the package modules can be imported from the top:
4646
import {
4747
NativeRouter as Router,
4848
DeepLinking,
49-
AndroidBackButton,
49+
BackButton,
5050
Link,
5151
Route
5252
// etc.

0 commit comments

Comments
 (0)