: resolveFrom(path.resolve('node_modules'), 'react-dom'),\n },\n }\n return config\n}\n\nconst includeSrcDirectory = config =\u003E {\n config.resolve = {\n ...config.resolve,\n modules: [path.resolve('src'), ...config.resolve.modules],\n }\n return config\n}\n\nmodule.exports = [\n ['use-babel-config', '.babelrc'],\n ['use-eslint-config', '.eslintrc'],\n fixLinkedDependencies,\n \u002F\u002F includeSrcDirectory,\n]\n","directory_shortid":null,"id":"c5655c08-5996-4b4f-bdff-798ee991a22a","inserted_at":"2020-11-20T06:16:39","is_binary":false,"sha":null,"shortid":"SJBeUy1r9D","source_id":"3355e052-c6a3-4757-8298-6d34ab8b82b9","title":".rescriptsrc.js","updated_at":"2020-11-20T06:16:39","upload_id":null},{"code":"# Example\n\nTo run this example:\n\n- `npm install` or `yarn`\n- `npm run start` or `yarn start`\n","directory_shortid":null,"id":"11c42413-a6a5-49ac-a837-8bfd2b4c1b47","inserted_at":"2020-11-20T06:16:39","is_binary":false,"sha":null,"shortid":"BkIl8JJS5w","source_id":"3355e052-c6a3-4757-8298-6d34ab8b82b9","title":"README.md","updated_at":"2020-11-20T06:16:39","upload_id":null},{"code":"{\n \"private\": true,\n \"scripts\": {\n \"start\": \"rescripts start\",\n \"build\": \"rescripts build\",\n \"test\": \"rescripts test\",\n \"eject\": \"rescripts eject\"\n },\n \"dependencies\": {\n \"axios\": \"0.19.2\",\n \"react\": \"^16.8.6\",\n \"react-dom\": \"^16.8.6\",\n \"react-query\": \"2.23.1\",\n \"react-query-devtools\": \"^2.4.7\",\n \"react-scripts\": \"3.0.1\",\n \"stop-runaway-react-effects\": \"^1.2.0\",\n \"styled-components\": \"^4.3.2\"\n },\n \"devDependencies\": {\n \"@rescripts\u002Fcli\": \"^0.0.11\",\n \"@rescripts\u002Frescript-use-babel-config\": \"^0.0.8\",\n \"@rescripts\u002Frescript-use-eslint-config\": \"^0.0.9\",\n \"babel-eslint\": \"10.0.1\"\n },\n \"browserslist\": {\n \"production\": [\n \"\u003E0.2%\",\n \"not dead\",\n \"not op_mini all\"\n ],\n \"development\": [\n \"last 1 chrome version\",\n \"last 1 firefox version\",\n \"last 1 safari version\"\n ]\n }\n}","directory_shortid":null,"id":"d1aece97-6dd0-48eb-bf71-fdca8d8cea5a","inserted_at":"2020-11-20T06:16:39","is_binary":false,"sha":null,"shortid":"SkveUJkHcD","source_id":"3355e052-c6a3-4757-8298-6d34ab8b82b9","title":"package.json","updated_at":"2020-11-20T06:16:39","upload_id":null},{"code":"\u003C!DOCTYPE html\u003E\n\u003Chtml lang=\"en\"\u003E\n \u003Chead\u003E\n \u003Cmeta charset=\"utf-8\" \u002F\u003E\n \u003Clink rel=\"shortcut icon\" href=\"%PUBLIC_URL%\u002Ffavicon.ico\" \u002F\u003E\n \u003Cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1\" \u002F\u003E\n \u003Cmeta name=\"theme-color\" content=\"#000000\" \u002F\u003E\n \u003C!--\n manifest.json provides metadata used when your web app is installed on a\n user's mobile device or desktop. See https:\u002F\u002Fdevelopers.google.com\u002Fweb\u002Ffundamentals\u002Fweb-app-manifest\u002F\n --\u003E\n \u003Clink rel=\"manifest\" href=\"%PUBLIC_URL%\u002Fmanifest.json\" \u002F\u003E\n \u003C!--\n Notice the use of %PUBLIC_URL% in the tags above.\n It will be replaced with the URL of the `public` folder during the build.\n Only files inside the `public` folder can be referenced from the HTML.\n\n Unlike \"\u002Ffavicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%\u002Ffavicon.ico\" will\n work correctly both with client-side routing and a non-root public URL.\n Learn how to configure a non-root public URL by running `npm run build`.\n --\u003E\n \u003Ctitle\u003EReact App\u003C\u002Ftitle\u003E\n \u003C\u002Fhead\u003E\n \u003Cbody\u003E\n \u003Cnoscript\u003EYou need to enable JavaScript to run this app.\u003C\u002Fnoscript\u003E\n \u003Cdiv id=\"root\"\u003E\u003C\u002Fdiv\u003E\n \u003C!--\n This HTML file is a template.\n If you open it directly in the browser, you will see an empty page.\n\n You can add webfonts, meta tags, or analytics to this file.\n The build step will place the bundled scripts into the \u003Cbody\u003E tag.\n\n To begin the development, run `npm start` or `yarn start`.\n To create a production bundle, use `npm run build` or `yarn build`.\n --\u003E\n \u003C\u002Fbody\u003E\n\u003C\u002Fhtml\u003E\n","directory_shortid":"Syg8k1rqv","id":"01141706-bcaf-4463-b81c-ab119b2219e0","inserted_at":"2020-11-20T06:16:39","is_binary":false,"sha":null,"shortid":"HyuxL11rcD","source_id":"3355e052-c6a3-4757-8298-6d34ab8b82b9","title":"index.html","updated_at":"2020-11-20T06:16:39","upload_id":null},{"code":"{\n \"short_name\": \"React App\",\n \"name\": \"Create React App Sample\",\n \"icons\": [\n {\n \"src\": \"favicon.ico\",\n \"sizes\": \"64x64 32x32 24x24 16x16\",\n \"type\": \"image\u002Fx-icon\"\n }\n ],\n \"start_url\": \".\",\n \"display\": \"standalone\",\n \"theme_color\": \"#000000\",\n \"background_color\": \"#ffffff\"\n}\n","directory_shortid":"Syg8k1rqv","id":"2aed2c81-3f43-4c00-876e-ac8f2a03df32","inserted_at":"2020-11-20T06:16:39","is_binary":false,"sha":null,"shortid":"rJKx8J1ScD","source_id":"3355e052-c6a3-4757-8298-6d34ab8b82b9","title":"manifest.json","updated_at":"2020-11-20T06:16:39","upload_id":null},{"code":"\u002F* eslint-disable jsx-a11y\u002Fanchor-is-valid *\u002F\nimport React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport axios from \"axios\";\nimport {\n useQuery,\n useQueryCache,\n QueryCache,\n ReactQueryCacheProvider,\n} from \"react-query\";\nimport { ReactQueryDevtools } from \"react-query-devtools\";\n\nconst queryCache = new QueryCache();\n\nfunction App() {\n const [postId, setPostId] = React.useState(-1);\n\n return (\n \u003CReactQueryCacheProvider queryCache={queryCache}\u003E\n \u003Cp\u003E\n As you visit the posts below, you will notice them in a loading state\n the first time you load them. However, after you return to this list and\n click on any posts you have already visited again, you will see them\n load instantly and background refresh right before your eyes!{\" \"}\n \u003Cstrong\u003E\n (You may need to throttle your network speed to simulate longer\n loading sequences)\n \u003C\u002Fstrong\u003E\n \u003C\u002Fp\u003E\n {postId \u003E -1 ? (\n \u003CPost postId={postId} setPostId={setPostId} \u002F\u003E\n ) : (\n \u003CPosts setPostId={setPostId} \u002F\u003E\n )}\n \u003CReactQueryDevtools initialIsOpen \u002F\u003E\n \u003C\u002FReactQueryCacheProvider\u003E\n );\n}\n\nfunction usePosts() {\n return useQuery(\"posts\", async () =\u003E {\n const { data } = await axios.get(\n \"https:\u002F\u002Fjsonplaceholder.typicode.com\u002Fposts\"\n );\n return data;\n });\n}\n\nfunction Posts({ setPostId }) {\n const cache = useQueryCache();\n const { status, data, error, isFetching } = usePosts();\n\n return (\n \u003Cdiv\u003E\n \u003Ch1\u003EPosts\u003C\u002Fh1\u003E\n \u003Cdiv\u003E\n {status === \"loading\" ? (\n \"Loading...\"\n ) : status === \"error\" ? (\n \u003Cspan\u003EError: {error.message}\u003C\u002Fspan\u003E\n ) : (\n \u003C\u003E\n \u003Cdiv\u003E\n {data.map((post) =\u003E (\n \u003Cp key={post.id}\u003E\n \u003Ca\n onClick={() =\u003E setPostId(post.id)}\n href=\"#\"\n style={\n \u002F\u002F We can use the queryCache here to show bold links for\n \u002F\u002F ones that are cached\n cache.getQueryData([\"post\", post.id])\n ? {\n fontWeight: \"bold\",\n color: \"green\",\n }\n : {}\n }\n \u003E\n {post.title}\n \u003C\u002Fa\u003E\n \u003C\u002Fp\u003E\n ))}\n \u003C\u002Fdiv\u003E\n \u003Cdiv\u003E{isFetching ? \"Background Updating...\" : \" \"}\u003C\u002Fdiv\u003E\n \u003C\u002F\u003E\n )}\n \u003C\u002Fdiv\u003E\n \u003C\u002Fdiv\u003E\n );\n}\n\nconst getPostById = async (key, id) =\u003E {\n const { data } = await axios.get(\n `https:\u002F\u002Fjsonplaceholder.typicode.com\u002Fposts\u002F${id}`\n );\n return data;\n};\n\nfunction usePost(postId) {\n return useQuery([\"post\", postId], getPostById, {\n enabled: postId,\n });\n}\n\nfunction Post({ postId, setPostId }) {\n const { status, data, error, isFetching } = usePost(postId);\n\n return (\n \u003Cdiv\u003E\n \u003Cdiv\u003E\n \u003Ca onClick={() =\u003E setPostId(-1)} href=\"#\"\u003E\n Back\n \u003C\u002Fa\u003E\n \u003C\u002Fdiv\u003E\n {!postId || status === \"loading\" ? (\n \"Loading...\"\n ) : status === \"error\" ? (\n \u003Cspan\u003EError: {error.message}\u003C\u002Fspan\u003E\n ) : (\n \u003C\u003E\n \u003Ch1\u003E{data.title}\u003C\u002Fh1\u003E\n \u003Cdiv\u003E\n \u003Cp\u003E{data.body}\u003C\u002Fp\u003E\n \u003C\u002Fdiv\u003E\n \u003Cdiv\u003E{isFetching ? \"Background Updating...\" : \" \"}\u003C\u002Fdiv\u003E\n \u003C\u002F\u003E\n )}\n \u003C\u002Fdiv\u003E\n );\n}\n\nconst rootElement = document.getElementById(\"root\");\nReactDOM.render(\u003CApp \u002F\u003E, rootElement);\n","directory_shortid":"B1xl8JJBqP","id":"8d009e64-7be6-4f37-88f0-5c16115454a6","inserted_at":"2020-11-20T06:16:39","is_binary":false,"sha":null,"shortid":"r1cxUkJr9v","source_id":"3355e052-c6a3-4757-8298-6d34ab8b82b9","title":"index.js","updated_at":"2020-11-20T06:16:39","upload_id":null},{"code":"https:\u002F\u002Frawcdn.githack.com\u002Ftannerlinsley\u002Freact-query\u002Fmaster\u002Fexamples\u002Fbasic\u002Fpublic\u002Ffavicon.ico","directory_shortid":"Syg8k1rqv","id":"0ebad795-49a4-4c2b-a0a7-9466cd814412","inserted_at":"2020-11-20T06:16:39","is_binary":true,"sha":null,"shortid":"SyjlI1JrqD","source_id":"3355e052-c6a3-4757-8298-6d34ab8b82b9","title":"favicon.ico","updated_at":"2020-11-20T06:16:39","upload_id":null}],"room_id":null,"base_git":null,"updated_at":"2020-11-20T06:16:39","external_resources":[],"privacy":0,"is_frozen":false,"forked_template_sandbox":null,"fork_count":32,"user_liked":false,"preview_secret":null,"is_sse":false,"picks":[],"forked_from_sandbox":null,"like_count":0,"tags":[],"authorization":"read","screenshot_url":"https:\u002F\u002Fscreenshots.codesandbox.io\u002Fzruoj\u002F12.png","team":null,"title":"tannerlinsley\u002Freact-query: basic","git":{"branch":"master","commit_sha":"7535383eba20fcfb0e476dbf199823d1423cd7e1","path":"examples\u002Fbasic","repo":"react-query","username":"tannerlinsley"},"pr_number":null,"original_git_commit_sha":null,"version":12,"template":"create-react-app","custom_template":{"color":"#61DAFB","icon_url":"github","id":"0105c3c4-bd51-40c8-9072-6c2b50458200","official":false,"published":true,"title":"tannerlinsley\u002Freact-query: basic","url":null}};