const App = () => ( <Layout> <Switch> {Object.values(routes).map((route, index) => ( route.auth ? <RoutePrivate {...route} key={index} path={typeof route.path === 'function' ? route.path() : route.path}/> : <Route {...route} key={index} path={typeof route.path === 'function' ? route.path() : route.path}/> ))} <Route component={NotFound}/> </Switch> </Layout> )
function App() { return ( <ScrollToTop> <Switch> <Route exact path="/" component={LoadableHome} /> <Route path="/generator" component={LoadableGenerator} /> <Route path="/about" component={LoadableAbout} /> <Route path="*" component={LoadableError404} /> </Switch> </ScrollToTop> ) }
render() { const activeStyle = { color: 'blue' }; return ( <div> <div> <NavLink exact to="/" activeStyle={activeStyle}>Home</NavLink> {' | '} <NavLink to="/fuel-savings" activeStyle={activeStyle}>Demo App</NavLink> {' | '} <NavLink to="/about" activeStyle={activeStyle}>About</NavLink> </div> <Switch> <Route exact path="/" component={HomePage} /> <Route path="/fuel-savings" component={FuelSavingsPage} /> <Route path="/about" component={AboutPage} /> <Route component={NotFoundPage} /> </Switch> </div> ); }
render() { return ( <Router history={history}> <Body> <Route component={Navbar} /> <Route component={ModalRoot} /> <Route component={Toasts} /> <Switch> <PrivateRoute exact path="/" component={Dashboard} /> <PrivateRoute path="/users/:username" component={Users} /> <PrivateRoute path="/users" component={Users} /> <PrivateRoute path="/communities/:slug" component={Communities} /> <PrivateRoute path="/communities" component={Communities} /> <PrivateRoute path="/threads" component={Threads} /> </Switch> </Body> </Router> ); }
{message && <p>{message}</p>} </MessageHeader> <Switch> <Route path="/"
toggle={this._toggleSidebar} /> : null} <Switch> <Route exact strict path="/:url*" render={props => <Redirect to={`${props.location.pathname}/`}/>} /> <Route path="/" exact component={Splash} /> render={props => ( <Container className="site__content"> <Switch> <Route path="/vote" component={Vote} /> <Route path="/organization" component={Organization} />
const App = () => ( <Fragment> <Helmet titleTemplate="%s | Hacktoberfest Checker" /> <GithubCorner /> <RegisterReminder /> <PageWrapper> <Router> <Switch> <Route exact path="/" component={Home} /> <Route exact path="/user/:username" component={User} /> <Route exact path="/me" component={Me} /> <Route exact path="/faq" component={Faq} /> <Route component={NotFound} /> </Switch> </Router> </PageWrapper> <Footer /> </Fragment> )
<Switch> <Route exact
const SettingsRoutes = ({ url }) => ( <div className="prajkumar settings_prajkumar"> <Switch> <Route path={`${url}`} exact component={ProfileSettings} /> <Route path={`${url}/change-password`} component={ChangePassword} /> <Route path={`${url}/deactivate`} component={Deactivate} /> <Redirect to="/error" /> </Switch> </div> )
export default function App() { return ( <Router> <div className="layout-wrapper"> <Switch> <Route path="/register" exact component={loadable(() => import('../containers/RegisterPage'))} /> <Route path="/login" exact component={loadable(() => import('../containers/LogInPage'))} /> <Route exact path={FUNCTION_ROUTERS}> <Route path={FUNCTION_ROUTERS} exact component={MainView} /> <Route path={FUNCTION_ROUTERS} exact component={RightView} /> </Route> <Route component={loadable(() => import('../components/NotFound'))} /> </Switch> </div> </Router> ); }
const GroupRoutes = ({ url, grp_id }) => ( <div className="hmm"> <Switch> <Route path={`${url}`} exact component={() => <GroupPosts grp_id={grp_id} />} /> <Route path={`${url}/gallery`} component={GroupGallery} /> <Route path={`${url}/about`} component={AboutGroup} /> <Route path={`${url}/edit`} component={() => <EditGroup grp_id={grp_id} />} /> <Route path={`${url}/members`} component={GroupMembers} /> <Route path={`${url}/add-members`} component={() => <AddGroupMembers grp_id={grp_id} />} /> <Redirect to="/error" /> </Switch> </div> )
const AppRoutes = () => ( <div className="badshah"> <Switch> <Route path="/" exact component={Home} /> <Route path="/profile/:username" component={Profile} /> <Route path="/error/:what" component={Error} /> <Route path="/email-verification/:is" component={EmailVerification} /> <Route path="/notifications" component={Notifications} /> <Route path="/edit-profile" component={EditProfile} /> <Route path="/post/:post_id" component={ViewPost} /> <Route path="/explore" component={Explore} /> <Route path="/settings" component={Settings} /> <Route path="/group/:grp_id" component={Group} /> <Route path="/messages" component={Messages} /> <Route path="/hashtag/:hashtag" component={Hashtag} /> <Route path="/admin-login" component={AdminLogin} /> <Route path="/is-admin" component={IsAdmin} /> <Route component={Error} /> </Switch> </div> )
const App = () => ( <Layout> <Switch> {Object.values(routes).map((route, index) => ( route.auth ? <RoutePrivate {...route} key={index} path={typeof route.path === 'function' ? route.path() : route.path}/> : <Route {...route} key={index} path={typeof route.path === 'function' ? route.path() : route.path}/> ))} <Route component={NotFound}/> </Switch> </Layout> )
{message && <p>{message}</p>} </MessageHeader> <Switch> <Route path="/"
const ExploreRoutes = ({ url }) => ( <div className="exp_hmm"> <Switch> <Route path={`${url}`} exact component={ExploreUsers} /> <Route path={`${url}/explore-photos`} component={ExplorePhotos} /> <Route path={`${url}/explore-groups`} component={ExploreGroups} /> <Redirect to="/error" /> </Switch> </div> )