react router returning to homepage

Viewed 95

I have an app built and at the end of the quiz I want a simple link that leads back to the homepage... I would assume that when you click the link on the last page it renders just the homepage but it seems to be showing me a blank page...

This homepage has the route set up for '/' and should display the ParentComponent. but when i click the link to the '/' path (in my finalScore component) it just leads me to a blank page. does anyone know why?

homepage looks like this:

import QFIB from './QFIB'
import AFIB from './AFIB'

const App = () => {
  return (
    <Router>
    <Nav />
      <div class='qAndAContainer'>
    <Route path='/' exact component={ParentComponent} />
    <Route path='/StartTest' component={StartTest} />
     </div>
    </Router>
  )
}

export default App;

and my last page looks like this: *it consists right now of just a simply link that says home which should take the user back to the homepage... I already set up where the hompage should be rendered in my app file so why is this giving me a blank page?

const FinalScore = ({score}) => {
  return (
     <Link to='/' exact>home</Link>
     <div/>
     </Switch>
     </Router>
  )
}
0 Answers
Related