Skip to content

Commit 8db490f

Browse files
committed
Fix <Link> context
1 parent a9a7f00 commit 8db490f

File tree

1 file changed

+4
-4
lines changed
  • packages/react-router-native

1 file changed

+4
-4
lines changed

packages/react-router-native/Link.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { TouchableHighlight } from 'react-native'
33

44
class Link extends Component {
55
static contextTypes = {
6-
router: React.PropTypes.object
6+
history: React.PropTypes.object
77
}
88

99
static propTypes = {
@@ -21,13 +21,13 @@ class Link extends Component {
2121
}
2222

2323
handlePress = () => {
24-
const { router } = this.context
24+
const { history } = this.context
2525
const { to, replace } = this.props
2626

2727
if (replace) {
28-
router.replace(to)
28+
history.replace(to)
2929
} else {
30-
router.push(to)
30+
history.push(to)
3131
}
3232
}
3333

0 commit comments

Comments
 (0)