I am working on the React Solo Project 4. I am trying to link the start quiz button to the Quiz page. I'm currently working on a fork from the Scrim to work on this project. When I look up linking pages, it seems like people are using React-router to link web pages. Should I install this dependency to make the link? I have included a link to my Scrim.
https://scrimba.com/scrim/co505438699c287626f840a19
#React Solo Project 4 Link from Start Page to Quiz
7 messages · Page 1 of 1 (latest)
No, you don't need React Router for this --- you can just use conditional rendering
You could use React-router but it's not the most suitable to this project. A better approach is to conditionally render either the start component or the quiz component.
^something like this... I've created as showStartScreen state, and when it's set to false it will render the Quiz component instead of the Start component.
For the way you set your app, you will need to pass down a function to your Start component that allows the state to be changed via an onClick
^Like this. And you had an anchor tag on that button don't forget to remove that. You don't need it if you're going to use conditional rendering.