We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b300c59 commit b094769Copy full SHA for b094769
packages/react-router-native/NativeRouter.js
@@ -7,6 +7,16 @@ class StoreHistory extends React.Component {
7
router: PropTypes.object.isRequired
8
}
9
10
+ static propTypes = {
11
+ initialIndex: PropTypes.number,
12
+ initialEntries: PropTypes.array
13
+ }
14
+
15
+ static defaultProps = {
16
+ initialIndex: 0,
17
+ initialEntries: [ '/' ]
18
19
20
componentDidMount() {
21
this.store()
22
@@ -53,8 +63,8 @@ class NativeRouter extends React.Component {
53
63
AsyncStorage.getItem('history', (err, history) => {
54
64
this.setState({
55
65
savedHistory: history ? JSON.parse(history) : {
56
- entries: [ '/' ],
57
- index: 0
66
+ entries: this.props.initialEntries,
67
+ index: this.props.initialIndex
58
68
59
69
})
60
70
0 commit comments