{"id":51003938,"url":"https://github.com/taiseen/react-design-patterns","last_synced_at":"2026-06-20T18:01:32.424Z","repository":{"id":325478307,"uuid":"1099026159","full_name":"taiseen/react-design-patterns","owner":"taiseen","description":"React - Design Patterns","archived":false,"fork":false,"pushed_at":"2025-12-23T22:06:29.000Z","size":141,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-25T11:56:14.795Z","etag":null,"topics":["compound-components","container-presenter","controlled-components","custom-hooks","design-patterns","hoc","react","react-design-patterns","render-prop","uncontrolled-components","vite"],"latest_commit_sha":null,"homepage":"https://react-dp.netlify.app","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/taiseen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2025-11-18T13:09:17.000Z","updated_at":"2025-12-23T22:06:33.000Z","dependencies_parsed_at":"2026-01-04T03:04:17.895Z","dependency_job_id":null,"html_url":"https://github.com/taiseen/react-design-patterns","commit_stats":null,"previous_names":["taiseen/react-design-patterns"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/taiseen/react-design-patterns","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taiseen%2Freact-design-patterns","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taiseen%2Freact-design-patterns/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taiseen%2Freact-design-patterns/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taiseen%2Freact-design-patterns/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/taiseen","download_url":"https://codeload.github.com/taiseen/react-design-patterns/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taiseen%2Freact-design-patterns/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34580039,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-20T02:00:06.407Z","response_time":98,"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":["compound-components","container-presenter","controlled-components","custom-hooks","design-patterns","hoc","react","react-design-patterns","render-prop","uncontrolled-components","vite"],"created_at":"2026-06-20T18:01:31.500Z","updated_at":"2026-06-20T18:01:32.418Z","avatar_url":"https://github.com/taiseen.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e 16 - November - 2025\n\n# React - Design Patterns\n\n\n| #  | Pattern Name                          | Description                                                                             |\n|----|---------------------------------------|-----------------------------------------------------------------------------------------|\n| 1  | Container-Presenter                   | Separates business logic (Container) from UI rendering (Presenter)                      |\n| 2  | Controlled vs Uncontrolled            | Controlled: state managed by props/callbacks. Uncontrolled: uses refs for DOM access    |\n| 3  | Compound Components                   | Parent component shares state with named children (e.g., `Dropdown.Menu`)               |\n| 4  | Render Props                          | Shares logic via a function prop (`render` or `children`) that returns JSX              |\n| 5  | Higher-Order Component (HOC)          | A function that wraps a component to enhance it (e.g., `withAuth`, `withLogging`)       |\n| 6  | Custom Hooks                          | Encapsulates reusable logic in a function starting with `use` (e.g., `useLocalStorage`) |\n| 7  | Provider (Context API)                | Uses `createContext()` to pass data through the tree without prop drilling              |\n| 8  | Optimistic UI                         | updating the UI immediately as if an operation succeeded — before the server confirms it|\n| 9  | State Reducer                         | Uses `useReducer` to manage complex state; allows parent to override reducer behavior   |\n| 10 | Observer / Pub-Sub                    | Event-driven communication using emitters (e.g., `EventTarget`, `mitt`)                 |\n\n## 🎯 Recommended Focus (80/20 Rule)\n\nThe following **5 patterns cover ~80% of real-world React development needs**:\n\n- ✅ **Custom Hooks**\n- ✅ **Compound Components**\n- ✅ **State Reducer**\n- ✅ **Controlled Component**\n- ✅ **Provider (Context API)**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaiseen%2Freact-design-patterns","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftaiseen%2Freact-design-patterns","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaiseen%2Freact-design-patterns/lists"}