{"id":22267519,"url":"https://github.com/t1amat9409/react-query","last_synced_at":"2026-05-11T06:20:31.985Z","repository":{"id":57119656,"uuid":"160159505","full_name":"t1amat9409/react-query","owner":"t1amat9409","description":"From a medium article by Tim Kolberger, https://medium.com/@TimKolb/creating-a-reusable-react-query-component-for-your-rest-api-1aa91ef2551b","archived":false,"fork":false,"pushed_at":"2018-12-03T09:16:17.000Z","size":6,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T03:48:06.377Z","etag":null,"topics":["api","fetch","query","react","react-native"],"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/t1amat9409.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":"2018-12-03T08:44:40.000Z","updated_at":"2020-07-17T16:53:31.000Z","dependencies_parsed_at":"2022-08-23T21:20:34.280Z","dependency_job_id":null,"html_url":"https://github.com/t1amat9409/react-query","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/t1amat9409%2Freact-query","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t1amat9409%2Freact-query/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t1amat9409%2Freact-query/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t1amat9409%2Freact-query/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/t1amat9409","download_url":"https://codeload.github.com/t1amat9409/react-query/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245485306,"owners_count":20623229,"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":["api","fetch","query","react","react-native"],"created_at":"2024-12-03T11:06:53.744Z","updated_at":"2026-05-11T06:20:26.954Z","avatar_url":"https://github.com/t1amat9409.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @itxbornfire/react-query\n\nFrom Tim's article, and the codesandbox he peovided, this is how a basic component should look like.\nOf course you can style it as you wish as shown here https://codesandbox.io/s/92n5zmoq2y?from-embed .\n\n```JavaScript\n  import React, { Fragment } from \"react\";\n  import { Query } from \"@itxbornfire/react-query\";\n  \n  import {\n    LoadingComponent,\n    ErrorComponent\n  } from \".../path/to/your/components\";\n\n  export const BasicQuery = () =\u003e (\n    \u003cFragment\u003e\n      \u003ch2\u003eBasicQuery\u003c/h2\u003e\n      \u003cQuery url=\"https://api.github.com\"\u003e\n        {({ state: { data, loading, error }, actions }) =\u003e {\n          if (loading) {\n            return \u003cLoadingComponent /\u003e;\n          }\n\n          if (error) {\n            return \u003cErrorComponent error={error} /\u003e;\n          }\n\n          if (data) {\n            return (\n              \u003cReact.Fragment\u003e\n                \u003cbutton onClick={actions.fetch}\u003e\n                  Reload\n                \u003c/button\u003e\n                {\n                  //render your data\n                }\n              \u003c/React.Fragment\u003e\n            );\n          }\n\n          return null;\n        }}\n      \u003c/Query\u003e\n    \u003c/Fragment\u003e\n  );\n  \n```\nHere's an interactive sandbox, the original sandbox by Tim himself.\n\n[![Edit 92n5zmoq2y](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/92n5zmoq2y)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft1amat9409%2Freact-query","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ft1amat9409%2Freact-query","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft1amat9409%2Freact-query/lists"}