{"id":21936682,"url":"https://github.com/ilz5753/react-tools","last_synced_at":"2026-04-18T04:31:26.442Z","repository":{"id":210472727,"uuid":"726632052","full_name":"ilz5753/react-tools","owner":"ilz5753","description":null,"archived":false,"fork":false,"pushed_at":"2023-12-07T05:32:17.000Z","size":161,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-22T02:36:22.359Z","etag":null,"topics":["react","react-library","react-module","react-native","typescript"],"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/ilz5753.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-12-02T22:52:52.000Z","updated_at":"2023-12-03T00:48:31.000Z","dependencies_parsed_at":"2023-12-06T17:47:18.094Z","dependency_job_id":null,"html_url":"https://github.com/ilz5753/react-tools","commit_stats":null,"previous_names":["ilz5753/react-tools"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ilz5753/react-tools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilz5753%2Freact-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilz5753%2Freact-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilz5753%2Freact-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilz5753%2Freact-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ilz5753","download_url":"https://codeload.github.com/ilz5753/react-tools/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilz5753%2Freact-tools/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31956798,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["react","react-library","react-module","react-native","typescript"],"created_at":"2024-11-29T01:15:44.275Z","updated_at":"2026-04-18T04:31:26.425Z","avatar_url":"https://github.com/ilz5753.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Tools Library\n\n`@ilz5753/react-tools` is a comprehensive utility library for React, offering an assortment of hooks, providers, and components oriented towards optimizing common development patterns in React and enhancing overall functionality.\n\n## Features\n\n### `ErrorHandlerProvider`\n\nProvides a context for managing errors across a React application. Utilize the ErrorHandlerProvider to centrally capture and handle errors within your application.\n\n### `EventEmitter`\n\nImplements the publish/subscribe pattern, enabling components to broadcast events and register corresponding event listeners. This facilitates communication between disparate components without resorting to prop drilling or context usage.\n\n### `forgottonProviderMessage`\n\nAssists development by issuing a meaningful warning when attempting to access context values without the presence of a surrounding `\u003cProvider\u003e`. This feature aids in identifying missing providers during early stages of development.\n\n### `FreezeProvider`\n\nThis provider allows you to “freeze” your application state, prohibiting state updates and re-renders. It is beneficial for scenarios where you need to ensure the UI remains invariant, such as during critical animations or transitions.\n\n### `GenerateTreeFromArray`\n\nThis utility function transforms a flat array structure into a tree, typically useful for creating hierarchies from flat data structures. It is valuable for menu navigation, file systems, or any hierarchical representation of data.\n\n### `NavigationProvider`\n\nManages navigation within your application via a context provider. Use `NavigationProvider` to oversee the current location, navigation history, and transitions between different views in a Single Page Application (SPA).\n\n### `useContext`\n\nA custom implementation of React’s built-in `useContext` hook, potentially incorporating additional developer warnings or enhancements. This hook provides access to context values using an interface identical to React’s native hook.\n\n### `useErrorHandler`\n\nThis custom hook interacts with the `ErrorHandlerProvider` to handle errors within components, simplifying the process of catching and handling errors locally or elevating them to a global handler.\n\n### `useFreeze`\n\nA hook that collaborates with `FreezeProvider` to control the “freezing” of your application’s state. It can be employed to trigger or apply the “frozen” status from within components.\n\n### `useNavigation`\n\nA hook tailored for interacting with `NavigationProvider`, facilitating streamlined access to navigation actions and state. Simplify the navigation and routing logic within components by utilizing this hook.\n\n## Installation\n\nTo integrate `@ilz5753/react-tools` into your project, simply install it using your package manager of choice:\n\n```bash\nnpm install @ilz5753/react-tools --save\n```\n\nor if you're using yarn:\n\n```bash\nyarn add @ilz5753/react-tools\n```\n\n## Usage\n\nHere's a quick example to get you started:\n\n```jsx\nimport { ErrorHandlerProvider, useErrorHandler } from \"@ilz5753/react-tools\";\n\nconst MyComponent = () =\u003e {\n  const { show } = useErrorHandler();\n\n  const dangerousAction = () =\u003e {\n    try {\n      // Something risky that might throw an error\n    } catch (error) {\n      show({\n        // ...\n      });\n    }\n  };\n\n  return \u003cbutton onClick={dangerousAction}\u003eDo Risky Thing\u003c/button\u003e;\n};\n\nconst App = () =\u003e (\n  \u003cErrorHandlerProvider\u003e\n    \u003cMyComponent /\u003e\n  \u003c/ErrorHandlerProvider\u003e\n);\n```\n\n## Contributing\n\nWe welcome your contributions! Please feel free to submit issues and pull requests to the [react-tools repository](#).\n\n## License\n\n`react-tools` is [MIT licensed](/LICENSE.txt).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filz5753%2Freact-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Filz5753%2Freact-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filz5753%2Freact-tools/lists"}