{"id":20857731,"url":"https://github.com/michaelfarquhar/react-snippets","last_synced_at":"2026-02-07T15:11:24.972Z","repository":{"id":260958314,"uuid":"882775171","full_name":"MichaelFarquhar/react-snippets","owner":"MichaelFarquhar","description":"Collection of react snippets that I use, supporting both JavaScript \u0026 TypeScript.","archived":false,"fork":false,"pushed_at":"2024-12-15T03:56:02.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-12T13:44:58.938Z","etag":null,"topics":["react-snippets","vscode-snippets"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MichaelFarquhar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-11-03T18:18:04.000Z","updated_at":"2024-12-15T03:56:06.000Z","dependencies_parsed_at":"2024-11-19T06:18:39.912Z","dependency_job_id":null,"html_url":"https://github.com/MichaelFarquhar/react-snippets","commit_stats":null,"previous_names":["michaelfarquhar/react-snippets"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MichaelFarquhar/react-snippets","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaelFarquhar%2Freact-snippets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaelFarquhar%2Freact-snippets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaelFarquhar%2Freact-snippets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaelFarquhar%2Freact-snippets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MichaelFarquhar","download_url":"https://codeload.github.com/MichaelFarquhar/react-snippets/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaelFarquhar%2Freact-snippets/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265483627,"owners_count":23774244,"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","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":["react-snippets","vscode-snippets"],"created_at":"2024-11-18T04:42:33.997Z","updated_at":"2026-02-07T15:11:19.953Z","avatar_url":"https://github.com/MichaelFarquhar.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Snippets\n\n![VS Code](https://img.shields.io/badge/VS%20Code-0078d7.svg?style=for-the-badge\u0026logo=visual-studio-code\u0026logoColor=white)\n![JavaScript](https://img.shields.io/badge/javascript-%23323330.svg?style=for-the-badge\u0026logo=javascript\u0026logoColor=%23F7DF1E)\n![TypeScript](https://img.shields.io/badge/typescript-%23007ACC.svg?style=for-the-badge\u0026logo=typescript\u0026logoColor=white)\n\nCollection of react snippets I use, supporting both JavaScript and TypeScript. I use these over the many pre-existing extensions because those generally clog up VS Code with tons of snippets i would never use.\n\n## How To Add Snippets\n\n- Open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P)\n- Type \"Configure User Snippets\" and select it\n- Choose \"New Global Snippets file...\"\n- Name your snippets file whatever you'd like\n- Copy and paste the snippets into the newly created file\n\n## ✂️ Snippets\n\n| Alias | Purpose                                      |\n|-------|----------------------------------------------|\n| imr   | Import React statement                       |\n| rc    | React Function Component with `export const` |\n| rct   | Same as above but with a props interface     |\n| ush   | useState Hook                                |\n| efh   | useEffect Hook                               |\n| ech   | useCallback Hook                             |\n| emh   | useMemo Hook                                 |\n| urh   | useRef Hook                                  |\n| tern  | Ternary Operator Condition                   |\n| ushLoad  | Generic loading state hook                |\n| uihh  | useImperativeHandle hook                     |\n| utt   | useTranslation hook with t function          |\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](/LICENSE) file for details.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelfarquhar%2Freact-snippets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichaelfarquhar%2Freact-snippets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelfarquhar%2Freact-snippets/lists"}