{"id":20645782,"url":"https://github.com/christopherkade/hooks-example","last_synced_at":"2026-04-21T14:34:15.829Z","repository":{"id":91591826,"uuid":"184279420","full_name":"christopherkade/hooks-example","owner":"christopherkade","description":"React Hooks Example","archived":false,"fork":false,"pushed_at":"2019-05-04T09:24:22.000Z","size":169,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-09T15:56:44.040Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/christopherkade.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-30T14:39:57.000Z","updated_at":"2019-05-04T09:24:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"50281745-95b5-4e86-a48f-fc93d01cc98e","html_url":"https://github.com/christopherkade/hooks-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/christopherkade/hooks-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christopherkade%2Fhooks-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christopherkade%2Fhooks-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christopherkade%2Fhooks-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christopherkade%2Fhooks-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/christopherkade","download_url":"https://codeload.github.com/christopherkade/hooks-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christopherkade%2Fhooks-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32095957,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-21T11:25:29.218Z","status":"ssl_error","status_checked_at":"2026-04-21T11:25:28.499Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":"2024-11-16T16:21:57.105Z","updated_at":"2026-04-21T14:34:15.782Z","avatar_url":"https://github.com/christopherkade.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"This repository contains examples for a presentation on React Hooks.\n\nHooks covered:\n- useState\n- useEffect\n\n## useState\n\n- Use State allows you to create stateful functional components\n- It has the following syntax: `const [value, setValue] = useState('defaultValue')` where the first element is the state variable and the second is a method used to update the state\n- To update the state, simply call `setValue` and pass the new state value as parameter, which enqueues a re-render of the component\n\n## useEffect\n\n- Use effect allows us to have lifecycle hooks in functional components\n- It has the following syntax: `useEffect(callback, (optional) [variable])` where the first argument is the method that is executed on each re-render and the second are variables that trigger the method only when they are updated\n- The second parameter allows us to control the firing of `useEffect`, by passing it `[]`, we will only trigger in twice: on mount and on unmount. We may also pass variables, which will then trigger `useEffect` only when said variables are updated. If no parameter is passed, the method is triggered on **each** re-render\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchristopherkade%2Fhooks-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchristopherkade%2Fhooks-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchristopherkade%2Fhooks-example/lists"}