{"id":22599276,"url":"https://github.com/charan379/react-hooks","last_synced_at":"2026-05-06T20:35:36.322Z","repository":{"id":197145990,"uuid":"698087656","full_name":"charan379/react-hooks","owner":"charan379","description":"This is a custom react hooks library for react based applications, This project is currenlty published at NPM with package name `@charan379/react-hooks`, so you can install it from NPM repository.","archived":false,"fork":false,"pushed_at":"2023-09-29T06:16:25.000Z","size":77,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-19T23:00:04.775Z","etag":null,"topics":["hooks","hooks-api-react","react","react-hooks","useonoutsideclick"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@charan379/react-hooks","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/charan379.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}},"created_at":"2023-09-29T06:13:08.000Z","updated_at":"2023-09-29T06:20:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"44718860-7b2c-4f6c-b05a-69af91102712","html_url":"https://github.com/charan379/react-hooks","commit_stats":null,"previous_names":["charan379/react-hooks"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/charan379/react-hooks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charan379%2Freact-hooks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charan379%2Freact-hooks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charan379%2Freact-hooks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charan379%2Freact-hooks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/charan379","download_url":"https://codeload.github.com/charan379/react-hooks/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charan379%2Freact-hooks/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32711466,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-06T19:35:05.142Z","status":"ssl_error","status_checked_at":"2026-05-06T19:35:03.996Z","response_time":117,"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":["hooks","hooks-api-react","react","react-hooks","useonoutsideclick"],"created_at":"2024-12-08T11:08:50.800Z","updated_at":"2026-05-06T20:35:36.317Z","avatar_url":"https://github.com/charan379.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-hooks\n\nThis is a custom react hooks library for react based applications.\n\n## Installation\n\nThis project is currenlty published at NPM with package name `@charan379/react-hooks`, so you can install it from NPM repository.\n\n```bash\nnpm install @charan379/react-hooks\n```\n\n## Usage\n\nTo import all hooks.\n\n```bash\nimport * from \"@charan379/react-hooks\"\n```\n\nTo import specific hook.\n\n```bash\nimport { \u003chook_name\u003e } from \"@charan379/react-hooks\"\n```\n\n### Example\n\n```bash\nimport { useOnOutsideClick } from \"@charan379/react-hooks\";\n```\n\n### Use it in your component like\n\n```bash\n  useOnOutsideClick(\n    # // [ ref : RefObject ] of element to be watched\n    ref,\n    # //[callBackFun; () =\u003e {} ] to be execute on outside click\n    () =\u003e {\n      console.log(\"Clicked out side this component\");\n    },\n    # // [executeOnlyOnTouchDevices : boolean ] whether only watch on touchscreen devices only of all other devices.\n    # // by default false\n    false\n  );\n```\n\n### Example React Code\n\n```bash\nimport { useOnOutsideClick } from \"@charan379/react-hooks\";\nimport React, { useCallback, useRef, useState } from \"react\";\n\nconst RevealOnClick = (props) =\u003e  {\n  const thisComponentRef = useRef(null);\n  const [reveal, setReveal] = useState(false);\n\n  useOnOutsideClick(\n    thisComponentRef,\n    useCallback(() =\u003e {\n      setReveal(false);\n    }, [thisComponentRef.current]),\n    false\n  );\n\n  return (\n    # if user clicks outside this div \u003cp\u003e tag will not be rendered\n    \u003cdiv ref={thisComponentRef}\u003e\n    .\n    .\n    # if user click on `Reveal Element` button \u003cp\u003e tag will be rendered\n    \u003cbutton onClick={() =\u003e setReveal(true)}\u003eReveal Element\u003c/button\u003e\n    .\n    .\n    {\n      reveal ? \u003cp\u003e This will render only if reveal true \u003c/p\u003e : \"\"\n    }\n    .\n    .\n    \u003c/div\u003e\n  )\n}\n\nexport default RevealOnClick;\n```\n\n## Authors\n\n- [@charan379](https://www.github.com/charan379)\n\n## License\n\n[![AGPL License](https://img.shields.io/badge/LICENSE-GNU%20AGPLv3-brightgreen)](https://www.gnu.org/licenses/agpl-3.0.en.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharan379%2Freact-hooks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcharan379%2Freact-hooks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharan379%2Freact-hooks/lists"}