{"id":13630524,"url":"https://github.com/ericclemmons/react.lazy-example","last_synced_at":"2025-03-19T01:31:17.132Z","repository":{"id":66108065,"uuid":"146395877","full_name":"ericclemmons/react.lazy-example","owner":"ericclemmons","description":"Testing out React.lazy (https://github.com/facebook/react/pull/13398)","archived":false,"fork":false,"pushed_at":"2018-09-04T06:05:38.000Z","size":47,"stargazers_count":24,"open_issues_count":1,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-10T19:03:21.134Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://react-lazy-example-qmehmnudqu.now.sh/","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/ericclemmons.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-28T05:23:50.000Z","updated_at":"2021-08-05T09:43:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"4acdc55d-563a-4830-9594-e995bb39c253","html_url":"https://github.com/ericclemmons/react.lazy-example","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/ericclemmons%2Freact.lazy-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericclemmons%2Freact.lazy-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericclemmons%2Freact.lazy-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericclemmons%2Freact.lazy-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericclemmons","download_url":"https://codeload.github.com/ericclemmons/react.lazy-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244336183,"owners_count":20436785,"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-08-01T22:01:45.855Z","updated_at":"2025-03-19T01:31:16.897Z","avatar_url":"https://github.com/ericclemmons.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"---\n\nimport Demo from \"./src/components/Demo\"\nimport Layout from \"./src/components/Layout\"\n\nexport default Layout\n\n---\n\n# `React.lazy` Example\n\nAfter [@acdlite](https://github.com/acdlite) merged https://github.com/facebook/react/pull/13398,\nI was curiuos if it would be possible to render an **async component** like:\n\n```jsx\nasync function Repos({ user }) {\n  const res = await fetch(...)\n  const repos = await res.json()\n\n  return \u003cul\u003e{repos.map(...)}\u003c/ul\u003e\n}\n```\n\n## Demo\n\n_Available at https://react-lazy-example-qmehmnudqu.now.sh/_\n\n\u003e \u003cDemo /\u003e\n\n---\n\n## Local Development\n\n1. Clone this repo.\n1. Next, we need a custom build of React with Suspense enabled:\n\n    1. `git submodule update` to install https://github.com/facebook/react/.\n    1. `yarn patch` to set `enableSuspense = true`\n    1. `yarn build` to build React with Suspense.\n\n1. `yarn install`\n1. `yarn dev`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericclemmons%2Freact.lazy-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericclemmons%2Freact.lazy-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericclemmons%2Freact.lazy-example/lists"}