{"id":16371282,"url":"https://github.com/deptno/react-script-fall","last_synced_at":"2026-05-01T04:35:25.656Z","repository":{"id":57344104,"uuid":"193639195","full_name":"deptno/react-script-fall","owner":"deptno","description":"🍂 Declarative async script loader with order control ","archived":false,"fork":false,"pushed_at":"2021-04-26T08:51:18.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-01T01:16:55.958Z","etag":null,"topics":["dom","hooks","react","react-hook","script"],"latest_commit_sha":null,"homepage":null,"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/deptno.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":"2019-06-25T05:17:53.000Z","updated_at":"2021-04-26T08:51:21.000Z","dependencies_parsed_at":"2022-09-11T09:00:41.360Z","dependency_job_id":null,"html_url":"https://github.com/deptno/react-script-fall","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/deptno%2Freact-script-fall","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deptno%2Freact-script-fall/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deptno%2Freact-script-fall/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deptno%2Freact-script-fall/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deptno","download_url":"https://codeload.github.com/deptno/react-script-fall/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239907192,"owners_count":19716583,"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":["dom","hooks","react","react-hook","script"],"created_at":"2024-10-11T03:07:32.390Z","updated_at":"2026-03-09T03:30:20.580Z","avatar_url":"https://github.com/deptno.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-script-fall\n\n**react-script-fall** is a `\u003cscript\u003e` tag loader\n\n- Declarative loading order control\n- SSR safe\n\n\u003e react@^16.8 is required\n\n```bash\nnpm install react-script-fall\n```\n\n## Why\nAs far as I known, `script` tag's `async` attribute can not be set '`false`,\nso we need something to control this.\n\n## Usage\n#### simple\n```typescript jsx\n\u003cScript src=\"https://cdn-dependency\" onLoad={(loaded) =\u003e console.log({loaded})}\u003e\n  \u003cScript src=\"https://cdn\" async/\u003e\n\u003c/Script\u003e\n```\n#### real world\n```typescript jsx\nconst InitSomething: FunctionComponent\u003c{initializeSomething(): void}\u003e = props =\u003e {\n  const [loaded, setLoaded] = useState(0)\n  const handleLoad = (loaded) =\u003e loaded \u0026\u0026 setLoaded(loaded + 1)\n  useEffect(() =\u003e {\n    if (loaded === 2) {\n      // todo initialize something\n      props.initializeSomething()\n    }\n  }, [loaded])\n  return (\n    \u003cScript src=\"https://cdn-dependency\" onLoad={handleLoad}\u003e\n      \u003cScript src=\"https://cdn\" onLoad={handleLoad}/\u003e\n    \u003c/Script\u003e\n  )\n}\n```\n\n## License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeptno%2Freact-script-fall","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeptno%2Freact-script-fall","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeptno%2Freact-script-fall/lists"}