{"id":21401471,"url":"https://github.com/spoonx/react-preloaded","last_synced_at":"2025-06-25T07:05:19.431Z","repository":{"id":57342646,"uuid":"108409907","full_name":"SpoonX/react-preloaded","owner":"SpoonX","description":"Show a placeholder while images are being preloaded.","archived":false,"fork":false,"pushed_at":"2017-11-13T12:01:12.000Z","size":67,"stargazers_count":4,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-26T01:11:48.002Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SpoonX.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-26T12:41:45.000Z","updated_at":"2018-04-01T07:38:23.000Z","dependencies_parsed_at":"2022-09-16T02:50:31.507Z","dependency_job_id":null,"html_url":"https://github.com/SpoonX/react-preloaded","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SpoonX/react-preloaded","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpoonX%2Freact-preloaded","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpoonX%2Freact-preloaded/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpoonX%2Freact-preloaded/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpoonX%2Freact-preloaded/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SpoonX","download_url":"https://codeload.github.com/SpoonX/react-preloaded/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpoonX%2Freact-preloaded/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261823738,"owners_count":23215141,"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-11-22T15:27:59.365Z","updated_at":"2025-06-25T07:05:19.402Z","avatar_url":"https://github.com/SpoonX.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Preload\n[![npm version](https://badge.fury.io/js/react-preloaded.svg)](http://badge.fury.io/js/react-preloaded)\n\nA React component to preload images. It renders a passed component during the loader phase, and renders its children once the images have been successfully fetched.\n\nThis repository was forked from [Sam Bernard](https://github.com/sambernard/react-preload).\n\n\n## Installation\n\n### npm\n\n```bash\nnpm install react-preloaded --save\n```\n\n## Usage\n\n```js\nvar Preload = require('react-preloaded').Preload;\n```\n\n```js\nvar loadingIndicator = (\u003cdiv\u003eLoading...\u003c/div\u003e);\nvar images = [];\n\n\u003cPreload\n  loadingIndicator={loadingIndicator}\n  images={images}\n  autoResolveDelay={3000}\n  onError={this._handleImageLoadError}\n  onSuccess={this._handleImageLoadSuccess}\n  resolveOnError={true}\n  mountChildren={true}\n\u003e\n\t{/* content to be rendered once loading is complete*/}\n\u003c/Preload\u003e\n```\n\n## Prop types\n\n```js\n   propTypes: {\n\t\t//Rendered on success\n\t\tchildren: PropTypes.element.isRequired,\n\n\t\t//Rendered during load\n\t\tloadingIndicator: PropTypes.node,\n\n\t\t//Array of image urls to be preloaded\n\t\timages: PropTypes.array,\n\n\t\t//If set, the preloader will automatically show\n\t\t//the children content after this amount of time\n\t\tautoResolveDelay: PropTypes.number,\n\n\t\t//Error callback. Is passed the error\n\t\tonError: PropTypes.func,\n\n\t\t//Success callback\n\t\tonSuccess: PropTypes.func,\n\n\t\t//Whether or not we should still show the content\n\t\t//even if there is a preloading error\n\t\tresolveOnError: PropTypes.bool\n\n        //Whether or not we should mount the child content after\n        //images have finished loading (or after autoResolveDelay)\n        mountChildren: PropTypes.bool\n    }\n```\n\n## Additional Details\n\nThis module also exposes `ImageCache` and `ImageHelper` which can be used to preload images\ndirectly, and can be accessed via `require('react-preloaded').ImageCache` and\n`require('react-preloaded').ImageHelper` respectively.\n\n## License\n\n[MIT][mit-license]\n\n[mit-license]: ./LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspoonx%2Freact-preloaded","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspoonx%2Freact-preloaded","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspoonx%2Freact-preloaded/lists"}