{"id":21241248,"url":"https://github.com/icyjoseph/lazy-render-with-img","last_synced_at":"2026-04-13T16:01:22.265Z","repository":{"id":37739459,"uuid":"360908342","full_name":"icyJoseph/lazy-render-with-img","owner":"icyJoseph","description":"Lazy render using native image lazy loading","archived":false,"fork":false,"pushed_at":"2021-04-24T08:11:32.000Z","size":27,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-15T03:44:49.952Z","etag":null,"topics":["lazy","lazy-render","native-lazy-loading","react","vite"],"latest_commit_sha":null,"homepage":"https://lazy-render-with-img.vercel.app/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/icyJoseph.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":"2021-04-23T14:19:05.000Z","updated_at":"2022-06-22T08:47:57.000Z","dependencies_parsed_at":"2022-09-13T19:31:15.064Z","dependency_job_id":null,"html_url":"https://github.com/icyJoseph/lazy-render-with-img","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/icyJoseph/lazy-render-with-img","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icyJoseph%2Flazy-render-with-img","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icyJoseph%2Flazy-render-with-img/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icyJoseph%2Flazy-render-with-img/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icyJoseph%2Flazy-render-with-img/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/icyJoseph","download_url":"https://codeload.github.com/icyJoseph/lazy-render-with-img/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icyJoseph%2Flazy-render-with-img/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31759540,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T15:25:13.801Z","status":"ssl_error","status_checked_at":"2026-04-13T15:25:09.162Z","response_time":93,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["lazy","lazy-render","native-lazy-loading","react","vite"],"created_at":"2024-11-21T00:55:05.629Z","updated_at":"2026-04-13T16:01:22.247Z","avatar_url":"https://github.com/icyJoseph.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lazy Render\n\nPerhaps an anti pattern, but this project shows how to use `loading=lazy` on an `img` element to lazy render a component.\n\nIn this particular case, the lazy rendered component, triggers a call to `react-toastify`.\n\n```tsx\nimport { ToastContainer, toast } from \"react-toastify\";\nimport { LazyRender } from \"native-lazy-render\";\n\nconst HelloWorld = () =\u003e {\n  useEffect(() =\u003e {\n    toast(\"Hello World!\", { toastId: \"Hello\" });\n  }, []);\n\n  return null;\n};\n\nexport default function App() {\n  const [show, setShow] = useState(true);\n\n  useEffect(() =\u003e {\n    if (!show) {\n      const handler = () =\u003e setShow(true);\n      window.addEventListener(\"scroll\", handler);\n      return () =\u003e window.removeEventListener(\"scroll\", handler);\n    }\n  }, [show]);\n\n  return (\n    \u003c\u003e\n      \u003cToastContainer /\u003e\n\n      \u003cheader className=\"text\"\u003e\n        \u003ch1\u003eLazy Render\u003c/h1\u003e\n        \u003ch2\u003eScroll down\u003c/h2\u003e\n        \u003cbutton onClick={() =\u003e setShow(false)}\u003eReload\u003c/button\u003e\n      \u003c/header\u003e\n\n      \u003cdiv className=\"long\"\u003e\u003c/div\u003e\n\n      {show \u0026\u0026 (\n        \u003cLazyRender\u003e\n          \u003cHelloWorld /\u003e\n        \u003c/LazyRender\u003e\n      )}\n\n      \u003cfooter className=\"text\"\u003eEnd\u003c/footer\u003e\n    \u003c/\u003e\n  );\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficyjoseph%2Flazy-render-with-img","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ficyjoseph%2Flazy-render-with-img","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficyjoseph%2Flazy-render-with-img/lists"}