{"id":17458108,"url":"https://github.com/pocesar/react-use-qrcode","last_synced_at":"2025-03-21T03:33:33.601Z","repository":{"id":57347178,"uuid":"217231077","full_name":"pocesar/react-use-qrcode","owner":"pocesar","description":"React hook that allows you to decode QR Code data in a webworker (through comlink) using @zxing/library with some adaptations for web workers. Performance-first, non-ui blocking code. Uses OffscreenCanvas if available","archived":false,"fork":false,"pushed_at":"2019-10-24T06:50:05.000Z","size":7,"stargazers_count":8,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-10T23:02:16.071Z","etag":null,"topics":["browser","decoder","esnext","hooks-api-react","mjs","qrcode","qrcode-reader","qrcode-scanner","react","react-hook","react-hooks","reactjs","typescript","video","zxing","zxing-qrcode"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/pocesar.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}},"created_at":"2019-10-24T06:49:18.000Z","updated_at":"2024-06-03T21:03:16.000Z","dependencies_parsed_at":"2022-09-19T12:00:23.251Z","dependency_job_id":null,"html_url":"https://github.com/pocesar/react-use-qrcode","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pocesar%2Freact-use-qrcode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pocesar%2Freact-use-qrcode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pocesar%2Freact-use-qrcode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pocesar%2Freact-use-qrcode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pocesar","download_url":"https://codeload.github.com/pocesar/react-use-qrcode/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244734070,"owners_count":20501014,"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":["browser","decoder","esnext","hooks-api-react","mjs","qrcode","qrcode-reader","qrcode-scanner","react","react-hook","react-hooks","reactjs","typescript","video","zxing","zxing-qrcode"],"created_at":"2024-10-18T03:54:29.756Z","updated_at":"2025-03-21T03:33:33.265Z","avatar_url":"https://github.com/pocesar.png","language":"TypeScript","readme":"# react-use-qrcode\n\nReact hook that allows you to decode QR Code data in a webworker (through comlink) using [@zxing/library](https://github.com/zxing-js/library) with some adaptations for web workers. Performance-first, non-ui blocking code. Uses [OffscreenCanvas](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas) if available\n\n## Example\n\n```tsx\nimport useQrcode from 'react-use-qrcode'\n\nconst App: React.FC = () =\u003e {\n  const { ref, result, stop } = useQrcode({\n    width: 300,\n    height: 300\n  })\n\n  useEffect(() =\u003e {\n    if (result) {\n      stop()\n    }\n  }, [result, stop])\n\n  return (\n    \u003c\u003e\n      \u003cvideo ref={ref} autoPlay width={300} height={300} /\u003e\n      \u003cp\u003e{ result ? result : null }\u003c/p\u003e\n    \u003c/\u003e\n  )\n}\n```\n\n## Example\n\nRun `npm run example` on the root then open `https://localhost` (accept the self signed certificate generated by Parcel)\n\n## Caveats\n\n* Need to always use a `\u003cvideo ref={ref}\u003e` element and provide the ref.\n* Need to always pass in a number width / height to the hook, can't use percentages or `vh`/`vw` (doesn't mean you can't stretch the `\u003cvideo\u003e` element itself)\n* Not tested on non-evergreen browsers (IE, Opera, Samsung Browser, etc)\n* `webrtc-adapter` might be needed for some weird browsers\n* [react-use-comlink](https://github.com/pocesar/react-use-comlink) is a peer dep, install manually\n\n## License\n\nMIT","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpocesar%2Freact-use-qrcode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpocesar%2Freact-use-qrcode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpocesar%2Freact-use-qrcode/lists"}