Answers for "Reactjs electronjs blank screen on protected route"

0

Reactjs electronjs blank screen on protected route

Do not ask me why, but all you need to do is: 
replace Router or BrowserRouter with HashRouter

example:
return (
    <HashRouter>
        <div>
        <Header/>
            <Switch>
             <Route path="/" component={Home} exact/>
             <Route path="/news" component={News} exact/>
             <Route path="/store" component={Store} exact/>
             <Route path="/login" component={Login} exact/>
             <ProtectedRoute path="/profile" component={Profile} exact/>
           </Switch>
        </div> 
      </HashRouter>
  )
Posted by: Guest on July-23-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language