{"id":22477385,"url":"https://github.com/atomic-state/react-kuh","last_synced_at":"2026-02-22T09:04:14.994Z","repository":{"id":110078918,"uuid":"579156575","full_name":"atomic-state/react-kuh","owner":"atomic-state","description":"TypeScript-ready React (kinda) useful stuff","archived":false,"fork":false,"pushed_at":"2025-11-15T18:52:05.000Z","size":27,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-15T20:36:54.149Z","etag":null,"topics":["custom-hooks","react","react18"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/atomic-state.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-12-16T20:05:42.000Z","updated_at":"2025-11-15T18:52:09.000Z","dependencies_parsed_at":"2024-05-13T03:29:35.606Z","dependency_job_id":"7d4e9145-85bb-4970-af8a-f7edaf7d23ef","html_url":"https://github.com/atomic-state/react-kuh","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/atomic-state/react-kuh","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomic-state%2Freact-kuh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomic-state%2Freact-kuh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomic-state%2Freact-kuh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomic-state%2Freact-kuh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atomic-state","download_url":"https://codeload.github.com/atomic-state/react-kuh/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomic-state%2Freact-kuh/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29707521,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-22T05:59:28.568Z","status":"ssl_error","status_checked_at":"2026-02-22T05:58:46.208Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["custom-hooks","react","react18"],"created_at":"2024-12-06T14:10:39.206Z","updated_at":"2026-02-22T09:04:14.977Z","avatar_url":"https://github.com/atomic-state.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"### react-kuh\r\n\r\nTypeScript-ready React (kinda) useful hooks\r\n\r\n#### `useWindowSize()`\r\n\r\nUsage\r\n\r\n```tsx\r\nimport { useWindowSize } from 'react-kuh'\r\n\r\nfunction App(){\r\n  const windowSize = useWindowSize()\r\n\r\n  return (\r\n    \u003cdiv\u003e\r\n      \u003cp\u003eWidth: {windowSize.width}\u003c/p\u003e\r\n      \u003cp\u003eHeight: {windowSize.height}\u003c/p\u003e\r\n    \u003c/div\u003e\r\n  )\r\n}\r\n```\r\n\r\n#### `useBoolean()`\r\n\r\nUsage\r\n\r\n```tsx\r\nimport { useBoolean } from 'react-kuh'\r\n\r\nfunction App(){\r\n  const [active, actions] = useBoolean(false) // if not present, default is null\r\n\r\n  return (\r\n    \u003cdiv\u003e\r\n      \u003cbutton onClick={actions.on}\u003eActive\u003c/button\u003e\r\n      \u003cbutton onClick={actions.off}\u003eInactive\u003c/button\u003e\r\n      \u003cbutton onClick={actions.off}\u003eInactive\u003c/button\u003e\r\n      \u003cbutton onClick={() =\u003e actions.set(false)}\u003eSet\u003c/button\u003e\r\n      \u003cbutton onClick={actions.reset}\u003eReset\u003c/button\u003e\r\n    \u003c/div\u003e\r\n  )\r\n}\r\n```\r\n\r\n#### `useObject`\r\n\r\nUsage\r\n\r\n```tsx\r\nimport { useObject } from 'react-kuh'\r\n\r\ntype NoteType = {\r\n  title: string\r\n  content: string\r\n}\r\n\r\nfunction App() {\r\n  // Type is not required if it should be inferred from the default value\r\n  const [note, actions] = useObject\u003cNoteType\u003e({\r\n    title: '',\r\n    content: ''\r\n  })\r\n\r\n  function randomizeNote() {\r\n    actions.setValue({\r\n      title: Math.random().toString(12).split('.')[1],\r\n      content: Math.random().toString(12).split('.')[1]\r\n    })\r\n  }\r\n\r\n  return (\r\n    \u003cdiv\u003e\r\n      \u003cinput\r\n        value={note.title}\r\n        onChange={e =\u003e {\r\n          actions.setPartialValue({\r\n            title: e.target.value\r\n          })\r\n        }}\r\n      /\u003e\r\n      \u003cinput\r\n        value={note.content}\r\n        onChange={e =\u003e {\r\n          actions.setPartialValue({\r\n            content: e.target.value\r\n          })\r\n        }}\r\n      /\u003e\r\n      \u003cbutton onClick={actions.reset}\u003eReset to initial value\u003c/button\u003e\r\n      \u003cbutton onClick={randomizeNote}\u003eRandom\u003c/button\u003e\r\n    \u003c/div\u003e\r\n  )\r\n}\r\n```\r\n\r\n\r\n#### `useSecondRender`\r\n\r\nReturns `true` after the first render\r\n\r\n\r\n#### `BrowserOnly` (component)\r\n\r\nThis component renders its children after the first render. This can be used as a boundary when using SSR and a component should only be rendered in the client.\r\n\r\nUsage\r\n\r\n```jsx\r\nimport { BrowserOnly } from 'react-kuh'\r\n\r\nexport default function Page(){\r\n  return (\r\n    \u003cdiv\u003e\r\n      \u003ch2\u003eThis is SSR\u003c/h2\u003e\r\n      \u003cBrowserOnly\u003e\r\n        \u003cp\u003eThis is not SSR\u003c/p\u003e\r\n      \u003c/BrowserOnly\u003e\r\n    \u003c/div\u003e\r\n  )\r\n}\r\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatomic-state%2Freact-kuh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatomic-state%2Freact-kuh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatomic-state%2Freact-kuh/lists"}