{"id":32563055,"url":"https://github.com/blevs/react-timer","last_synced_at":"2025-10-29T02:56:42.879Z","repository":{"id":41719961,"uuid":"239360687","full_name":"Blevs/react-timer","owner":"Blevs","description":"A React tutorial project for creating a timer with useState and useEffect","archived":false,"fork":false,"pushed_at":"2023-01-05T06:50:06.000Z","size":4919,"stargazers_count":8,"open_issues_count":23,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-03-03T18:39:13.604Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Blevs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-09T19:23:37.000Z","updated_at":"2023-01-05T19:52:44.000Z","dependencies_parsed_at":"2023-02-03T16:31:00.360Z","dependency_job_id":null,"html_url":"https://github.com/Blevs/react-timer","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/Blevs/react-timer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blevs%2Freact-timer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blevs%2Freact-timer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blevs%2Freact-timer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blevs%2Freact-timer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Blevs","download_url":"https://codeload.github.com/Blevs/react-timer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blevs%2Freact-timer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281549787,"owners_count":26520515,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-29T02:00:06.901Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-29T02:56:22.579Z","updated_at":"2025-10-29T02:56:42.866Z","avatar_url":"https://github.com/Blevs.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Timer\n\n\u003cimg src=\"https://i.imgur.com/C81a9kw.gif\"\u003e\n\nLet's build a timer with React, and learn some very important lessons about `useState` and `useEffect` along the way.\n\nWe will be learning about how `useState` modifies values, how `useEffect` allows us to run code sometimes, and what the heck a 'cleanup function' is.\n\n## Goals\n\n* [ ] Create a working timer. It should start counting when the page loads via `useEffect`.\n* [ ] Track the number of seconds with `useState`.\n* [ ] Have a 'pause' button stop the timer.\n* [ ] Have a 'play' button re-start the timer.\n* [ ] Have a 'reset' button clear and stop the timer.\n\n## Stretch Goals\n\n* [ ] Display the pause button when the timer is running, and start button when the timer is stopped.\n* [ ] Disable the reset button when it isn't useful.\n* [ ] Display the time in a [hh:]mm:ss format.\n* [ ] Make your timer keep track of time more accurately by using [`Date.now()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/now) instead of assuming exactly a second has passed.\n* [ ] Make it a count down timer, instead of a stopwatch.\n* [ ] Allow the user to set the amount of time with an input.\n* [ ] Try to figure out the weird css to get the circle (and animation) around the time.\n\n## Notes\n\n* You can have a callback function run repeatedly with some delay using [`window.setInterval(func, delay)`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setInterval).\n* [`useEffect`](https://reactjs.org/docs/hooks-reference.html#useeffect) let's us run code with 'side effects' _sometimes_.\n\n## Install and Use\n\nTo run and edit the project, clone the project to your computer, `cd` into the project directory and follow the instructions below for your javascript pacakge manager of choice.\n\n### yarn\n\nIn the project directory run `yarn install` to install the depenencies, and `yarn start` to star the development server. It should open a browser tab to `localhost:3000`.\n\n### npm\n\nIn the project directory run `npm install` to install the depenencies, and `npm start` to star the development server. It should open a browser tab to `localhost:3000`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblevs%2Freact-timer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblevs%2Freact-timer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblevs%2Freact-timer/lists"}