INNER CODE UNIT · JavaScript
App
ujjavaldesai07/spring-boot-react-ecommerce-app · client/src/components/app.js:18
const App = () => {
log.info(`[App]: Rendering App Component`)
const [serverError, setServerError] = useState(false);
const setServerErrorHandler = () => {
setServerError(true)
}
return (
<Router history={history}>
<NavBar errorHandler={setServerErrorHandler}/>
<TabPanelList/>
{serverError ? null: <Switch>
<Route path="/" exact component={Home}/>
<Route path="/signin" exact component={SignIn}/>
<Route path="/signup" exact component={SignUp}/>
<Route path="/shopping-bag" exact component={ShoppingBag}/>
<Route path="/checkout" exact component={Checkout}/>