dimanche 26 juillet 2020

The main page becomes blank after some seconds

I made my React App, and then I have such problem: the page appears for 1 second and then disappears. What could cause this problem?

My App file:

import React from "react";
import LoginContainer from "./containers/login-container";
import { Route, HashRouter } from "react-router-dom";
import MainContainer from "./containers/main-container";
import { connect, Provider } from "react-redux";
import store from './redux/store'

const App = () => {

  return (  
    <div className="App">
      <Route path='/LoginPage' render={() => <LoginContainer/>} />
      <Route path='/Home' render={() => <MainContainer />} />
    </div>
  );
}


const mapStateToProps = (state) => ({
  isAuth: state.authReducer.isAuth
})

const AppContainer =  connect(mapStateToProps)(App)

const MainApp = () => {
  return <HashRouter> 
            <Provider store={store}>
                <AppContainer />
            </Provider>
          </HashRouter>
}

export default MainApp;



Aucun commentaire:

Enregistrer un commentaire