Welcome to the HearthSim React assessment. This project was bootstrapped with Create React App.
This assessment is to ensure you have basic knowledge of React and HTML. You should probably be able to complete it in around 20 minutes.
Your task is to update the files in src/
, so that when opened, the app behaves as follows:
- When the page opens, the text "Last Updated: Just now" is visible, with a button next to it
- After 10 seconds, the text becomes "Last Updated: A few seconds ago"
- After 60 seconds, and on every further full minute, the text becomes: "Last Updated: X minute(s) ago" where X is the number of full minutes that has passed
- When clicking the button, the (invisible) timer starts over
Please implement the behaviour above using a new "useAge" hook that you created.
For this basic assessment you do not need to add any tests or styling. You can also keep documentation minimal.
You're free to do any research you need during the test. Please stick to the template and the behaviours above.
First, run npm install
in the project directory. Then, run:
Open http://localhost:3000 to view the App in the browser.