-
Notifications
You must be signed in to change notification settings - Fork 0
/
ExplorePage.js
27 lines (25 loc) · 894 Bytes
/
ExplorePage.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import React, { Component } from 'react';
import { View, Text } from 'react-native';
import SwipeNavigationPageModel from './SwipeNavigationPageModel';
import Pagination from './Pagination';
import { inject, observer } from 'mobx-react';
import { reaction } from 'mobx';
class ExplorePage extends Component {
componentDidMount() {
this.willFocusListener = this.props.navigation.addListener('willFocus', () => {
SwipeNavigationPageModel.getInstance().index = 0;
});
}
componentWillUnmount() {
this.willFocusListener.remove();
}
render() {
return (
<View style={{ flex: 1 }}>
<Text>explore!</Text>
<Pagination total={2} index={this.props.swipeNavigationPageModel.index} />
</View>
);
}
}
export default inject('swipeNavigationPageModel')(observer(ExplorePage));