{"id":15963701,"url":"https://github.com/gwuhaolin/get-component-async","last_synced_at":"2026-05-01T09:31:28.079Z","repository":{"id":80950174,"uuid":"115703107","full_name":"gwuhaolin/get-component-async","owner":"gwuhaolin","description":"react component load for webpack async code split","archived":false,"fork":false,"pushed_at":"2019-01-02T08:50:50.000Z","size":8,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-04T12:51:23.362Z","etag":null,"topics":["code-splitting","webpack"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/gwuhaolin.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":"2017-12-29T08:21:25.000Z","updated_at":"2020-01-06T03:32:40.000Z","dependencies_parsed_at":"2023-03-12T12:49:11.738Z","dependency_job_id":null,"html_url":"https://github.com/gwuhaolin/get-component-async","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gwuhaolin/get-component-async","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gwuhaolin%2Fget-component-async","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gwuhaolin%2Fget-component-async/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gwuhaolin%2Fget-component-async/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gwuhaolin%2Fget-component-async/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gwuhaolin","download_url":"https://codeload.github.com/gwuhaolin/get-component-async/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gwuhaolin%2Fget-component-async/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32492100,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"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":["code-splitting","webpack"],"created_at":"2024-10-07T16:42:54.181Z","updated_at":"2026-05-01T09:31:28.060Z","avatar_url":"https://github.com/gwuhaolin.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# get-component-async\n\nload component async for react router\n\n## Use\n\ninstall by:\n\n```bash\nnpm i -S get-component-async\n```\n\n#### For react router\n\n```jsx harmony\nimport getComponentAsync from \"get-component-async\";\n\n\u003cHashRouter\u003e\n  \u003cRoute\n    path=\"/sub\"\n    component={getComponentAsync(\n      // webpack code split\n      () =\u003e import(\"./sub\")\n    )}\n  /\u003e\n\u003c/HashRouter\u003e;\n```\n\n`./sub` is code is:\n\n```jsx harmony\nexport default class Sub extends Component {\n  render() {\n    return \u003cdiv\u003esub\u003c/div\u003e;\n  }\n}\n```\n\n#### For big component\n\n```jsx harmony\nimport { getElementAsync } from \"get-component-async\";\n\n\u003cdiv\u003e\n  ...others\n  {getElementAsync(() =\u003e import(\"./bigComponent\"))}\n\u003c/div\u003e;\n```\n\n#### Show loading before loaded\n\n```jsx harmony\nimport { getElementAsync } from \"get-component-async\";\n\n\u003cdiv\u003e\n  ...others\n  {getElementAsync(() =\u003e import(\"./bigComponent\"), \u003cLoading /\u003e, props)}\n\u003c/div\u003e;\n```\n\n#### Set default loading before loaded\n\n```jsx harmony\nimport { setDefaultLoading } from \"get-component-async\";\n\nsetDefaultLoading(\u003cLoading /\u003e);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgwuhaolin%2Fget-component-async","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgwuhaolin%2Fget-component-async","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgwuhaolin%2Fget-component-async/lists"}