Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 140817

React Router not recognizing route, redirects me to blank screen

$
0
0

I am using react router v4, and I register a route and try and make a link to it, but when I click the link or type it in manually it doesn't seem to register the contents and doesn't even recognize the route at all

Here is me registering and making the link

<div className="main-contain">
        <Route exact={true} path='/testingroute' component={TestBlock}/>
        <span>Click <Link to={'/testingroute'} className="main-link">here</Link> for further details!</span>
</div>

Here is the component that the route is supposed to render

const TestBlock = (props) => {
  console.log("this is being called");

  return (
    <span>Test</span>
  );
}

The app is wrapped in a <BrowserRouter> by the way

Could use some help as I have been trying to get this work for the past few days. Please and thank you


Viewing all articles
Browse latest Browse all 140817

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>