IjzerenHein / react-navigation-shared-element

React Navigation bindings for react-native-shared-element 💫
https://github.com/IjzerenHein/react-native-shared-element
MIT License
1.27k stars 124 forks source link

react native problem with navigation #160

Closed Rivzmarere closed 3 years ago

Rivzmarere commented 3 years ago

Screenshot (35)

The app.js


import 'react-native-gesture-handler';
import * as React from 'react';
import {
  StyleSheet,
  View,
  Text
} from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import { createDrawerNavigator } from '@react-navigation/drawer';
import Login from './scr/components/Login/Login';
import splash from './Splash';
import Home from './scr/components/Home/Home';
import Canteen from './scr/components/Canteen/Canteen';
import ChartBox from './scr/components/ChartBox/ChartBox';

const Stack = createStackNavigator();

const Drawer = createDrawerNavigator();
function DrawerROutes() {
  return (
      <Drawer.Navigator initialRouteName="Home">
        <Drawer.Screen name="Home" component={Home} />
        <Drawer.Screen name="Canteen" component={Canteen} />
        <Drawer.Screen name="ChartBox" component={ChartBox} />
      </Drawer.Navigator>
  );
}

function App()

{

    return(
      <NavigationContainer>
        <Stack.Navigaor>
          <Stack.Screen name="splash" component={splash}/>
          <Stack.Screen name="Login" component={Login}/>
          <Stack.Screen name="Home" component={DrawerROutes}/>
        </Stack.Navigaor>
      </NavigationContainer>

    );
}

const styles = StyleSheet.create({
  container:{
    flex: 1,
    backgroundColor: '#F5FCFF',
  }
})

export default App;

The dependencies

"dependencies": {
    "@react-native-community/masked-view": "^0.1.11",
    "@react-navigation/drawer": "^5.12.5",
    "@react-navigation/native": "^5.9.4",
    "@react-navigation/stack": "^5.14.4",
    "install": "^0.13.0",
    "npm": "^7.11.2",
    "react": "17.0.1",
    "react-native": "0.64.0",
    "react-native-gesture-handler": "^1.10.3",
    "react-native-reanimated": "^1.13.3",
    "react-native-safe-area-context": "^3.2.0",
    "react-native-screens": "^3.1.1",
    "react-native-shared-element": "^0.7.0",
    "react-navigation": "^4.4.4",
    "react-navigation-drawer": "^2.7.1",
    "react-navigation-shared-element": "^2.3.1",
    "react-navigation-stack": "^2.10.4"
  }
StefanoMartella commented 3 years ago

I think you have a typo; you wrote Stack.Navigaor instead of Stack.Navigator

IjzerenHein commented 3 years ago

Your example doesn't event reference react-navigation-shared-element. Closing this issue