{"id":22106984,"url":"https://github.com/legitcode/react-fetch","last_synced_at":"2026-02-12T07:03:01.861Z","repository":{"id":33055633,"uuid":"36692045","full_name":"Legitcode/react-fetch","owner":"Legitcode","description":"Component wrapper for isomorphic-fetch, passes response to children","archived":false,"fork":false,"pushed_at":"2020-12-26T17:19:22.000Z","size":2239,"stargazers_count":119,"open_issues_count":1,"forks_count":14,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-05-21T11:19:16.181Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://zach.codes/react-fetch/example/dist/","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/Legitcode.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":"2015-06-01T22:12:29.000Z","updated_at":"2023-11-29T11:51:34.000Z","dependencies_parsed_at":"2022-08-24T13:20:32.348Z","dependency_job_id":null,"html_url":"https://github.com/Legitcode/react-fetch","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Legitcode%2Freact-fetch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Legitcode%2Freact-fetch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Legitcode%2Freact-fetch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Legitcode%2Freact-fetch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Legitcode","download_url":"https://codeload.github.com/Legitcode/react-fetch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227515122,"owners_count":17782642,"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":[],"created_at":"2024-12-01T08:13:28.646Z","updated_at":"2026-02-12T07:02:56.821Z","avatar_url":"https://github.com/Legitcode.png","language":"JavaScript","readme":"# React Fetch\n\n## Install\n\n    npm install react-fetch\n\n## Props\n\n- `url`: where to fetch json data from\n- `onSuccess`: function on successfully fetching the data\n- `onError`: function to be called on error\n- `options`: object containing parameters for the request (see the [fetch](https://fetch.spec.whatwg.org/) spec)\n\n## Example\n\npass an api endpoint and the resulting object will be passed as a prop.\n\n```js\nimport React from \"react\";\nimport Fetch from \"react-fetch\";\n\nfunction App() {\n  const handleError = (error) =\u003e console.log(error);\n  const handleSuccess = (data) =\u003e console.log(data);\n\n  return (\n    \u003cFetch\n      url=\"http://httpbin.org/headers\"\n      onSuccess={handleSuccess}\n      onError={handleError}\n    \u003e\n      \u003cUserAgent /\u003e\n    \u003c/Fetch\u003e\n  );\n}\n\nfunction UserAgent(props) {\n  return (\n    \u003cdiv\u003e\n      {props.headers ? (\n        \u003cdiv\u003eYour User-Agent: {props.headers[\"User-Agent\"]}\u003c/div\u003e\n      ) : (\n        \"Loading ...\"\n      )}\n    \u003c/div\u003e\n  );\n}\n```\n\n### Rebuilding\n\nRun this to view the example in `example/dist`\n\n    npm install\n    npm run build\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flegitcode%2Freact-fetch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flegitcode%2Freact-fetch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flegitcode%2Freact-fetch/lists"}