I am beginner in react native so may be my question seems silly to all experts.
but I am struggling with a basic feature that i want to implement that i want to start my
Just Follow this Simple Code.
App.js
import { createStackNavigator,createAppContainer } from "react-
navigation";
import Splash from "./Controller/Splash";
import Login from "./Controller/Login";
import Register from "./Controller/Register";
const Navigator = createStackNavigator ({
main: { screen: Splash },
LoginScreen: { screen : Login },
});
const AppNavigator = createAppContainer(Navigator);
export default class App extends Component {
render() {
return ;
}
}
Splash.js
import React, { Component } from "react";
import {View, Text } from "react-native";
export class Splash extends Component {
componentDidMount() {
setTimeout(() => {
this.load();
}, 4000);
}
load = () => {
this.props.navigation.push("LoginScreen");
};
render() {
return (
Splash Screen
);
}
}
export default Splash;
Hope this Helps :)