1
- import React , { PropTypes , Component } from 'react'
1
+ import React , { PropTypes } from 'react'
2
2
import MemoryRouter from 'react-router/MemoryRouter'
3
3
import { Alert } from 'react-native'
4
4
5
5
/**
6
- * The public API for a <Router> designed for React Native. Stores
7
- * locations using AsyncStorage and prompts using Alert .
6
+ * The public API for a <Router> designed for React Native. Gets
7
+ * user confirmations via Alert by default .
8
8
*/
9
- class NativeRouter extends Component {
9
+ class NativeRouter extends React . Component {
10
10
static propTypes = {
11
+ initialEntries : PropTypes . array ,
12
+ initialIndex : PropTypes . number ,
11
13
getUserConfirmation : PropTypes . func ,
12
14
keyLength : PropTypes . number ,
13
15
children : PropTypes . node
@@ -23,18 +25,7 @@ class NativeRouter extends Component {
23
25
}
24
26
25
27
render ( ) {
26
- const { initialEntries, initialIndex, getUserConfirmation, keyLength, children } = this . props
27
-
28
- return (
29
- < MemoryRouter
30
- initialEntries = { initialEntries }
31
- initialIndex = { initialIndex }
32
- getUserConfirmation = { getUserConfirmation }
33
- keyLength = { keyLength }
34
- >
35
- { React . Children . only ( children ) }
36
- </ MemoryRouter >
37
- )
28
+ return < MemoryRouter { ...this . props } />
38
29
}
39
30
}
40
31
0 commit comments