- Follow the instructions to fork & clone the GitHub repo
- Install the dependencies by running
npm install
- Launch server using
npm start
- It should automatically open http://localhost:3000/
You don't have to do all these exercises, just get started on them and see how many you manage.
-
Clicking on an answer should trigger the callback function.
-
The container component should use state to record the answers (whether they are true or false)
-
The app should fetch questions from the open trivia database API
-
Follow this link to the Trivia API. Play around with the number of questions, category and difficulty. Click
Generate API URL
, use this URL in yourfetch
function and see how your app changes. -
Create a score component that shows how many questions you got right.
-
(optional) Try changing the setting to 'Multiple Choice' rather than true or false. We are now re-using the
<button>
element insrc/components/Question.js
a lot, so we should extract it to be it's own separate component -
Each question should give an indication whether it was answered correctly or incorrectly - dynamically add a className to the button component after it is clicked. Then you can for example change the background-color of the component in the CSS file.
-
(optional) Create a button at the bottom of the page that says
New Questions
. When clicking it shouldfetch
more questions. -
Use PropTypes for all of the props in your Question component