-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApp.js
42 lines (38 loc) · 1012 Bytes
/
App.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import React, { Component } from "react";
import { StackNavigator } from "react-navigation";
import HomeScreen from "./components/Home";
import CameraScreen from "./components/Camera";
import DetectorScreen from "./components/Detector";
import ResultsScreen from "./components/Results";
const mapNavigationParamsToProps = SomeComponent => {
return class extends React.Component {
render() {
const { navigation, ...otherProps } = this.props;
// Unpack navigation params to send as props
const { state: { params } } = navigation;
return <SomeComponent {...this.props} {...params} />;
}
};
};
export default StackNavigator(
{
Home: {
screen: HomeScreen
},
Camera: {
screen: CameraScreen
},
Detector: {
screen: mapNavigationParamsToProps(DetectorScreen)
},
Results: {
screen: mapNavigationParamsToProps(ResultsScreen)
}
},
{
headerMode: "none",
navigationOptions: {
headerVisible: false
}
}
);