Archives : October-2018

I am trying to Redirect or Switch the following Hero React component after a 5 second delay using React-Router. <Redirect to=”/home” /> redirect’s the component to http://url.com/home instantly. Any suggestions on how to handle this? Thx. class Intro extends Component { render() { return ( <div className=”d-flex w-100 h-100 mx-auto p-4 flex-column”> <Header /> <div ..

Read more

I have a react app created with create-react-app and am using react-router-dom for routing. The general layout is: App.js <BrowserRouter> <BodyContent /> </BrowserRouter> Bodycontent.js <Fragment> <Navigation/> <main> <ScrollToTopRoute path=”/” exact component={HomePage}/> <ScrollToTopRoute path=”/page1″ exact component={Page1}/> <ScrollToTopRoute path=”/page1/page2″ exact component={Page2}/> <ScrollToTopRoute path=”/page3″ exact component={Page3}/> … etc… </main> </Fragment> The ScrollToTopRoute is simply an extension of the ..

Read more