{"id":24839411,"url":"https://github.com/devlander-software/higher-order-components","last_synced_at":"2026-01-19T23:01:48.285Z","repository":{"id":247834272,"uuid":"736791815","full_name":"Devlander-Software/higher-order-components","owner":"Devlander-Software","description":null,"archived":false,"fork":false,"pushed_at":"2024-09-24T22:28:42.000Z","size":1038,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-19T20:32:02.334Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/Devlander-Software.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","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},"funding":{"github":"landonwjohnson"}},"created_at":"2023-12-28T22:20:36.000Z","updated_at":"2024-09-24T22:27:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"7ad51e24-5c72-4d70-a327-353c11973b9f","html_url":"https://github.com/Devlander-Software/higher-order-components","commit_stats":null,"previous_names":["devlander-software/higher-order-components"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Devlander-Software/higher-order-components","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Devlander-Software%2Fhigher-order-components","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Devlander-Software%2Fhigher-order-components/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Devlander-Software%2Fhigher-order-components/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Devlander-Software%2Fhigher-order-components/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Devlander-Software","download_url":"https://codeload.github.com/Devlander-Software/higher-order-components/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Devlander-Software%2Fhigher-order-components/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018715,"owners_count":26086609,"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","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"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":[],"created_at":"2025-01-31T06:43:04.628Z","updated_at":"2025-10-14T13:30:45.708Z","avatar_url":"https://github.com/Devlander-Software.png","language":"TypeScript","funding_links":["https://github.com/sponsors/landonwjohnson"],"categories":[],"sub_categories":[],"readme":"\n![Devlander Higher Order Components Collection Header](https://github.com/Devlander-Software/higher-order-components/raw/main/media/images/react-high-order-components-github-cover.png)\n\n\u003ca href=\"https://twitter.com/intent/tweet?button_hashtag=DevlanderHigherOrderComponents\" target=\"_parent\"\u003e\n  \u003cimg alt=\"#DevlanderHigherOrderComponents\" src=\"https://img.shields.io/twitter/url?color=%2308a0e9\u0026label=DevlanderHigherOrderComponents\u0026style=social\u0026url=https%3A%2F%2Ftwitter.com%2Fintent%2Ftweet%3Fbutton_hashtag%DevlanderHigherOrderComponents\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://bit.ly/devlander-discord-invite\" target=\"_parent\"\u003e\n  \u003cimg alt=\"Join Devlander on Discord\" src=\"https://img.shields.io/badge/Discord-Devlander-%235865F2\" /\u003e\n\u003c/a\u003e\n\n\u003ca href=\"https://www.npmjs.com/package/@devlander/higher-order-components\" target=\"_parent\"\u003e\n  \u003cimg alt=\"npm downloads\" src=\"https://img.shields.io/npm/dm/@devlander/higher-order-components.svg\" /\u003e\n\u003c/a\u003e\n\n\u003ca href=\"https://github.com/orgs/Devlander-Software/discussions\"\u003e\n  \u003cimg alt=\"Join the discussion on Github\" src=\"https://img.shields.io/badge/Github%20Discussions%20%26%20Support-Chat%20now!-blue\" /\u003e\n\u003c/a\u003e\n\n\u003ca href=\"https://bit.ly/devlander-twitch\"\u003e\n  \u003cimg alt=\"Join Devlander on Twitch\" src=\"https://img.shields.io/twitch/status/devlander\" /\u003e\n\u003c/a\u003e\n\n\u003ca href=\"https://bit.ly/landonwjohnson-on-twitter\" target=\"_parent\"\u003e\n  \u003cimg alt=\"Follow Landon Johnson On Twitter\" src=\"https://img.shields.io/twitter/follow/landonwjohnson.svg?style=social\u0026label=Follow\" /\u003e\n\u003c/a\u003e \n\n\u003ca href=\"https://bit.ly/landonwjohnson-on-twitter\" target=\"_parent\"\u003e\n  \u003cimg alt=\"Wakatime Devlander higher-order-components\" src=\"https://wakatime.com/badge/user/bd50b6c5-e0ca-4937-83b3-ab2d13adbc73/project/018b1ae9-e146-4ac3-88fb-6e3097c4064c.svg\" /\u003e\n\u003c/a\u003e \n\n[![Hits](https://hits.sh/github.com/Devlander-Software/higher-order-components.svg?label=Hits)](https://hits.sh/github.com/Devlander-Software/higher-order-components/)\n\n\n# Devlander React Native Higher Order Components Collection\n\n## Introduction\n\nThe Devlander React Native Higher Order Components Collection is a comprehensive library of React Native higher-order-components, designed for seamless integration and addressing common development challenges. This collection streamlines your development process, offering versatile, cross-platform solutions for a variety of use cases.\n\n## Featured higher-order-components\n\n- **withBorders**: Wraps a container with borders for the sake of troubleshooting where views/divs end.\n- **withLogProps**: Logs props in a component.\n- **withVisibilitySensor**: Detects if a component is visible or not and passes an `isVisible` property down to the next component, which can be used to pass to another function.\n- **withMediaQueryInfo**: Keeps track of the size of the device and viewport, and returns a list of booleans. These are used to do conditional logic when rendering components on different devices, making things responsive.\n- **withViewSize**: Keeps track of the height and width of the component it is wrapping.\n- **withSpinner**: Displays a spinner while the wrapped component is in a loading state.\n\n## Installation\n\nYou can install the Devlander React Native Higher Order Components Collection using npm or yarn:\n\n### npm\n```bash\nnpm install @devlander/higher-order-components\n```\n\n### yarn\n```bash\nyarn add @devlander/higher-order-components\n```\n\n## Usage\n\n### withBorders\n\n```tsx\nimport React from \"react\";\nimport { View, Text } from \"react-native\";\nimport { withBorders } from \"@devlander/higher-order-components\";\n\ninterface MyComponentProps {\n  message: string;\n  withBorders?: boolean;\n  borderColor?: string;\n}\n\nconst MyComponent: React.FC\u003cMyComponentProps\u003e = ({ message, withBorders, borderColor }) =\u003e (\n  \u003cView\u003e\n    \u003cText\u003e{message}\u003c/Text\u003e\n  \u003c/View\u003e\n);\n\nconst EnhancedComponent = withBorders(MyComponent);\n\n// Usage example\n\u003cEnhancedComponent message=\"Hello, world!\" withBorders={true} borderColor=\"blue\" /\u003e\n```\n\n### withLogProps\n\n```tsx\nimport React from \"react\";\nimport { View, Text } from \"react-native\";\nimport { withLogProps } from \"@devlander/higher-order-components\";\n\ninterface MyComponentProps {\n  message: string;\n}\n\nconst MyComponent: React.FC\u003cMyComponentProps\u003e = ({ message }) =\u003e (\n  \u003cView\u003e\n    \u003cText\u003e{message}\u003c/Text\u003e\n  \u003c/View\u003e\n);\n\nconst EnhancedComponent = withLogProps(MyComponent);\n\n// Usage example\n\u003cEnhancedComponent message=\"Hello, world!\" /\u003e\n// This would console.log(\"Actual Props: \", { message: \"Hello, world!\" })\n```\n\n### withVisibilitySensor\n\n```tsx\nimport React from \"react\";\nimport { View, Text } from \"react-native\";\nimport { withVisibilitySensor } from \"@devlander/higher-order-components\";\n\ninterface MyComponentProps {\n  isVisible: boolean;\n  message: string;\n}\n\nconst MyComponent: React.FC\u003cMyComponentProps\u003e = ({ isVisible, message }) =\u003e (\n  \u003cView\u003e\n    \u003cText\u003e{isVisible ? \"Visible\" : \"Not Visible\"}: {message}\u003c/Text\u003e\n  \u003c/View\u003e\n);\n\nconst EnhancedComponent = withVisibilitySensor(MyComponent);\n\n// Usage example\n\u003cEnhancedComponent message=\"Hello, world!\" /\u003e\n```\n\n### withMediaQueryInfo\n\n```tsx\nimport React from \"react\";\nimport { View, Text } from \"react-native\";\nimport { withMediaQueryInfo, WithMediaQueryProps } from \"@devlander/higher-order-components\";\n\ninterface MyComponentProps extends WithMediaQueryProps {\n  message: string;\n}\n\nconst MyComponent: React.FC\u003cMyComponentProps\u003e = ({ mediaQueryInfo, message }) =\u003e (\n  \u003cView\u003e\n    \u003cText\u003e{mediaQueryInfo.large ? \"Large Screen\" : \"Small Screen\"}: {message}\u003c/Text\u003e\n    \u003cText\u003eMedia Query Info:\u003c/Text\u003e\n    \u003cText\u003exSmall: {mediaQueryInfo.xSmall.toString()}\u003c/Text\u003e\n    \u003cText\u003eSmall: {mediaQueryInfo.small.toString()}\u003c/Text\u003e\n    \u003cText\u003eMedium: {mediaQueryInfo.medium.toString()}\u003c/Text\u003e\n    \u003cText\u003eLarge: {mediaQueryInfo.large.toString()}\u003c/Text\u003e\n    \u003cText\u003exLarge: {mediaQueryInfo.xLarge.toString()}\u003c/Text\u003e\n    \u003cText\u003exxLarge: {mediaQueryInfo.xxLarge.toString()}\u003c/Text\u003e\n    \u003cText\u003ePlatform: {mediaQueryInfo.platform}\u003c/Text\u003e\n  \u003c/View\u003e\n);\n\nconst EnhancedComponent = withMediaQueryInfo(MyComponent);\n\n// Usage example\n\u003cEnhancedComponent message=\"Hello, world!\" /\u003e\n```\n\n### withSpinner\n\n```tsx\nimport React from \"react\";\nimport { View, Text } from \"react-native\";\nimport { withSpinner } from \"@devlander/higher-order-components\";\n\ninterface MyComponentProps extends WithSpinnerProps {\n  message: string;\n}\n\nconst MyComponent: React.FC\u003cMyComponentProps\u003e = ({ message, shouldSpin, spinnerComponent }) =\u003e (\n  // If `shouldSpin` is true, a spinner would show instead of this component.\n  \u003cView\u003e\n    \u003cText\u003e{message}\u003c/Text\u003e\n  \u003c/View\u003e\n);\n\nconst EnhancedComponent = withSpinner(MyComponent);\n\n// Usage example\n\u003cEnhancedComponent shouldSpin={true} message=\"Loading...\" /\u003e\n\n// Usage with custom spinner component\nconst CustomSpinner: React.FC = () =\u003e (\n  \u003cView\u003e\n    \u003cText\u003eLoading...\u003c/Text\u003e\n  \u003c/View\u003e\n);\n\n// Enhanced component with custom spinner\nconst EnhancedComponentWithCustomSpinner = withSpinner(MyComponent);\n\n// In the application\n\u003cEnhancedComponentWithCustomSpinner shouldSpin={true} spinnerComponent={CustomSpinner} message=\"Hello, world!\" /\u003e\n```\n\n## Contributing\n\nContributions are welcome! Please read our [contributing guidelines](https://github.com/Devlander-Software/higher-order-components/blob/main/CONTRIBUTING.md) first.\n\n## License\n\nThis project is licensed under the Apache License - see the [LICENSE](https://github.com/Devlander-Software/high-order-components/blob/main/LICENSE) file for details.\n\n## Connect with Us\n\n- Follow us on [Twitter](https://bit.ly/landonwjohnson-on-twitter)\n- Join our [Discord](https://bit.ly/devlander-discord-invite)\n- Watch us on [Twitch](https://bit.ly/devlander-twitch)\n\n### [Become a Sponsor!](https://bit.ly/sponsor-landonjohnson-github/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevlander-software%2Fhigher-order-components","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevlander-software%2Fhigher-order-components","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevlander-software%2Fhigher-order-components/lists"}