-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRouter.js
30 lines (25 loc) · 1.1 KB
/
Router.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
import * as React from 'react';
import { Component } from 'react';
import {connect} from 'react-redux';
import { createStackNavigator } from '@react-navigation/stack';
import { NavigationContainer } from '@react-navigation/native';
import ProductList from './src/screens/productList/ProductList';
import SpecificProduct from './src/screens/specificProduct/SpecificProduct';
import Cart from './src/screens/cart/Cart';
const Stack = createStackNavigator();
const RouterComp = () => {
return (
<NavigationContainer>
<Stack.Navigator name = 'mainStack' initialRouteName = 'home'>
<Stack.Screen name = 'productList' options = {{headerShown: false}} component = {ProductList}></Stack.Screen>
<Stack.Screen name = 'specificProduct' options = {{headerShown: false}} component = {SpecificProduct}></Stack.Screen>
<Stack.Screen name = 'cart' options = {{headerShown: false}} component = {Cart}></Stack.Screen>
</Stack.Navigator>
</NavigationContainer>
)
}
const mapStateToProps = state => {
return{
}
}
export default connect(mapStateToProps, {})(RouterComp)