When I open and close the application after login, I want the same page to be opened again, so the user does not log in again. Do not open the login page when the application is opened unless the user logs out. I want him to open the login page when I log out. When I do not check out / Home I want to open.
index.js
import {AppRegistry} from 'react-native';
import App from './App';
import {name as appName} from './app.json';
AppRegistry.registerComponent('ReactNativeAuth', () => App);
AppRegistry.registerComponent(appName, () => App);
App.js
import React from "react";
import { StyleSheet, Text, View } from "react-native";
import { NativeRouter, Switch, Route } from "react-router-native";
import Login from "./src/Login";
import Home from "./src/components/usrFirst";
export default class App extends React.Component {
render() {
return (
<NativeRouter>
<Route exact path="/" component={Login} />
<Route exact path="/Home" component={Home} />
</NativeRouter>
);
}
}