0
<MuiThemeProvider theme={muiTheme}>
            <V0MuiThemeProvider muiTheme={muiThemeV0}>
                <React.Fragment>
                    <Helmet
                        defaultTitle="Life"
                        titleTemplate="Life: %s"
                    />

                    <Switch>
                        <UnderDevelopmentPage path="/underdevelopment" component={UnderDevelopmentPage}/>
                        <LayoutDefault exact path={MyProfilePage.Path} component={MyProfilePage}/>
                        <LayoutDefault path={MyResultsPage.Path} component={MyResultsPage}/>
                        <LayoutDefault path={MyPlansPage.Path} component={MyPlansPage}/>
                        <LayoutDefault path={MyFinancePage.Path} component={MyFinancePage}/>
                        <LayoutDefault path={MyBenefitsPage.Path} component={MyBenefitsPage}/>
                        <LayoutDefault path={BIClub.Path} component={BIClub}/>
                        <LayoutDefault path={BIClubCatalogPage.Path} component={BIClubCatalogPage}/>
                        <LayoutDefault path={BIClubCompanyPage.Path} component={BIClubCompanyPage}/>
                        <LayoutDefault path={BIClubDiscountPage.Path} component={BIClubDiscountPage}/>
                        <LayoutDefault path={MyEventsPage.Path} component={MyEventsPage}/>
                        <LayoutDefault path={CompanyEventsPage.Path} component={CompanyEventsPage}/>
                        <LayoutDefault path={OutsideEventsPage.Path} component={OutsideEventsPage}/>
                        <LayoutDefault path={HistoryPage.Path} component={HistoryPage}/>
                        <LayoutDefault path={OutboxPage.Path} component={OutboxPage}/>
                        <LayoutDefault path={InboxPage.Path} component={InboxPage}/>
                        <LayoutDefault path="/404" component={Notfound}/>



                    </Switch>
                    <LeftSidebar/>
                </React.Fragment>
            </V0MuiThemeProvider>
        </MuiThemeProvider>

What a layotdefault i need to do for a page what doesnt have any route??? for all 404 page? This is all my route code simple Redirect doesnt help to me

2 Answers2

0

Passing anything besides a <Route> or <Redirect> is not encouraged, because <Switch> treat each child as route and Redirect is just an alias of Route.

Try to change your code like below:

<UnderDevelopmentPage path="/underdevelopment" component={UnderDevelopmentPage}/>
<LayoutDefault>
    <Switch>
        <Route exact path={MyProfilePage.Path} component={MyProfilePage}/>
        <Route path={MyResultsPage.Path} component={MyResultsPage}/>
        <Route path={MyPlansPage.Path} component={MyPlansPage}/>
        <Route path={MyFinancePage.Path} component={MyFinancePage}/>
        <Route path={MyBenefitsPage.Path} component={MyBenefitsPage}/>
        <Route path={BIClub.Path} component={BIClub}/>
        <Route path={BIClubCatalogPage.Path} component={BIClubCatalogPage}/>
        <Route path={BIClubCompanyPage.Path} component={BIClubCompanyPage}/>
        <Route path={BIClubDiscountPage.Path} component={BIClubDiscountPage}/>
        <Route path={MyEventsPage.Path} component={MyEventsPage}/>
        <Route path={CompanyEventsPage.Path} component={CompanyEventsPage}/>
        <Route path={OutsideEventsPage.Path} component={OutsideEventsPage}/>
        <Route path={HistoryPage.Path} component={HistoryPage}/>
        <Route path={OutboxPage.Path} component={OutboxPage}/>
        <Route path={InboxPage.Path} component={InboxPage}/>
        <Route component={Notfound}/>
    </Switch>

</LayoutDefault>
Shahram
  • 300
  • 1
  • 7
0

Hey :D I think you should use <route> nested on your <LayoutDefault>.