{"id":15917236,"url":"https://github.com/rmdort/react-async-load-script","last_synced_at":"2025-03-24T07:31:58.578Z","repository":{"id":27430505,"uuid":"113881310","full_name":"rmdort/react-async-load-script","owner":"rmdort","description":"A higher order React component to lazy load external javascript files sequentially","archived":false,"fork":false,"pushed_at":"2022-12-10T20:32:31.000Z","size":1414,"stargazers_count":4,"open_issues_count":29,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-19T03:13:11.609Z","etag":null,"topics":[],"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/rmdort.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"License.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-11T16:20:18.000Z","updated_at":"2023-02-02T04:42:27.000Z","dependencies_parsed_at":"2022-09-04T11:10:22.312Z","dependency_job_id":null,"html_url":"https://github.com/rmdort/react-async-load-script","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmdort%2Freact-async-load-script","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmdort%2Freact-async-load-script/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmdort%2Freact-async-load-script/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmdort%2Freact-async-load-script/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rmdort","download_url":"https://codeload.github.com/rmdort/react-async-load-script/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245227491,"owners_count":20580891,"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-10-06T18:09:43.530Z","updated_at":"2025-03-24T07:31:58.321Z","avatar_url":"https://github.com/rmdort.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React async script loader\n\nA higher order React component to lazy load external javascript files. Scripts are loaded sequentially.\n\nNote: Requires Promise polyfill\n\n## Installation\n\n````\nyarn add react-async-load-script\n````\n\n## Usage\n\n````\nimport scriptLoader from 'react-async-load-script'\n\nscriptLoader([...scripts])(YourComponent)\n````\n\n## Example\n\n````\nclass D3Chart extends React.Component {\n  componentDidUpdate (prevProps) {\n    if (\n      prevProps.isScriptLoadSucceed !== this.props.isScriptLoadSucceed \u0026\u0026 \n      this.props.isScriptLoadSucceed\n    ) {\n      // Initialize d3 chart\n      console.log(d3)\n    }\n  }\n  render () {\n    return \u003cdiv className='chart' /\u003e\n  }\n}\n\nexport default scriptLoader([\n  'https://cdnjs.cloudflare.com/ajax/libs/d3/4.12.0/d3.min.js\n])(D3Chart)\n````\n\n## Properties\n\nYour component will receive the following props\n\n|Name|Type|Description|\n|----|----|-----------|\n|isScriptLoaded|boolean|Indicates if scripts have been loaded|\n|isScriptLoadSuccess|boolean|Indicates if all scripts are loaded without error|\n\n## Test\n\n````\nyarn test\n````\n\n## License\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frmdort%2Freact-async-load-script","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frmdort%2Freact-async-load-script","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frmdort%2Freact-async-load-script/lists"}