{"id":15391012,"url":"https://github.com/michalkvasnicak/react-error-reporter","last_synced_at":"2025-07-30T01:38:09.311Z","repository":{"id":66133634,"uuid":"93385845","full_name":"michalkvasnicak/react-error-reporter","owner":"michalkvasnicak","description":"Simple error reporting using React components.","archived":false,"fork":false,"pushed_at":"2017-08-25T12:28:03.000Z","size":97,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-06T07:04:19.258Z","etag":null,"topics":["components","error-handling","react","react-native","sentry"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/michalkvasnicak.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2017-06-05T09:08:27.000Z","updated_at":"2023-03-10T09:49:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"57196528-d8d3-4c4b-bdfd-6a5155f16412","html_url":"https://github.com/michalkvasnicak/react-error-reporter","commit_stats":{"total_commits":10,"total_committers":1,"mean_commits":10.0,"dds":0.0,"last_synced_commit":"985c44e3a13caf5dea7d5fa4cc151fe7e49c3620"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/michalkvasnicak/react-error-reporter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michalkvasnicak%2Freact-error-reporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michalkvasnicak%2Freact-error-reporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michalkvasnicak%2Freact-error-reporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michalkvasnicak%2Freact-error-reporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michalkvasnicak","download_url":"https://codeload.github.com/michalkvasnicak/react-error-reporter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michalkvasnicak%2Freact-error-reporter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267793216,"owners_count":24144991,"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-07-29T02:00:12.549Z","response_time":2574,"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":["components","error-handling","react","react-native","sentry"],"created_at":"2024-10-01T15:09:35.881Z","updated_at":"2025-07-30T01:38:09.269Z","avatar_url":"https://github.com/michalkvasnicak.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-error-reporter\n\n[![npm](https://img.shields.io/npm/v/react-error-reporter.svg)](https://www.npmjs.com/package/react-error-reporter)\n[![CircleCI](https://circleci.com/gh/michalkvasnicak/react-error-reporter.svg?style=svg)](https://circleci.com/gh/michalkvasnicak/react-error-reporter)\n\n![gzip size](http://img.badgesize.io/https://unpkg.com/react-error-reporter/dist/react-error-reporter.min.js?compression=gzip\u0026label=gzip%20size)\n![size](http://img.badgesize.io/https://unpkg.com/react-error-reporter/dist/react-error-reporter.min.js?label=size)\n![module formats: umd, cjs, esm](https://img.shields.io/badge/module%20formats-umd%2C%20cjs%2C%20esm-green.svg)\n\nSimple error reporting using React components.\n\n`npm install --save react-error-reporter`\n\n## Example\n\n```js\nimport ErrorReporter, { CaptureException } from 'react-error-reporter';\n\n\u003cErrorReporter captureException={(error, ...args) =\u003e console.error(error, ...args)}\u003e\n  \u003cCaptureException error={new Error('Test Error')} extra={[{ contextToError: true }]} /\u003e\n\u003c/ErrorReporter\u003e\n```\n\n## Advanced Example\n\n```js\nimport GraphQL from 'react-apollo-graphql';\nimport ErrorReporter, { CaptureException } from 'react-error-reporter';\n\n\u003cErrorReporter captureException={console.error}\u003e\n  \u003cGraphQL queries={{ projects: ... }} render={(queries) =\u003e {\n    if (queries.projects.error) {\n      return \u003cCaptureException error={queries.projects.error} /\u003e;\n    }\n\n    if (queries.projects.loading) {\n      return \u003cLoading /\u003e;\n    }\n\n    return queries.projects.data.projects.map(\n      project =\u003e \u003cdiv key={project.id}\u003e{project.title}\u003c/div\u003e\n    );\n  }} /\u003e\n\u003c/ErrorReporter\u003e\n```\n\n## API\n\n### `\u003cErrorReporter /\u003e`\n\nProvides `captureException` to the `context`. Your app must be wrapped using this component.\n\n```js\ntype Props = {\n  captureException(error: Error, ...args: any): void,\n}\n```\n\n### `\u003cCaptureException /\u003e`\n\nCaptures exception, passing `error` and `extra` to `captureException` handler. This components renders `null`.\n\nCaptures exception on `componentWillMount()` if the `error` prop is set and `componentDidUpdate()` if the `error` props has changed and is set.\n\n```js\ntype Props = {\n  // optional error\n  // will be passed to captureException() as the first argument.\n  error: ?Error,\n\n  // passes extra data to captureException()\n  // each item in array is passed to captureException(error, item0, item1) as respective argument after the error\n  // for example extra={[{ test: 1 }, { test: 2 }]}\n  // will call captureException(error, { test: 1 }, { test: 2 })\n  extra: ?Array\u003cany\u003e,\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichalkvasnicak%2Freact-error-reporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichalkvasnicak%2Freact-error-reporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichalkvasnicak%2Freact-error-reporter/lists"}