{"id":21593679,"url":"https://github.com/yyz945947732/react-switch-case-render","last_synced_at":"2026-04-29T21:04:39.106Z","repository":{"id":194737729,"uuid":"691463299","full_name":"yyz945947732/react-switch-case-render","owner":"yyz945947732","description":"Switch-case React component to render nested components.","archived":false,"fork":false,"pushed_at":"2023-09-15T03:51:22.000Z","size":307,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-27T09:39:36.883Z","etag":null,"topics":["react","react-component","react-condition","react-switch-case"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/react-switch-case-render","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/yyz945947732.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-14T08:23:33.000Z","updated_at":"2023-09-28T05:39:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"eb39ee4f-a7a4-49f1-b47d-58741007d187","html_url":"https://github.com/yyz945947732/react-switch-case-render","commit_stats":null,"previous_names":["yyz945947732/react-switch-case-render"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yyz945947732/react-switch-case-render","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yyz945947732%2Freact-switch-case-render","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yyz945947732%2Freact-switch-case-render/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yyz945947732%2Freact-switch-case-render/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yyz945947732%2Freact-switch-case-render/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yyz945947732","download_url":"https://codeload.github.com/yyz945947732/react-switch-case-render/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yyz945947732%2Freact-switch-case-render/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32443582,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T20:22:27.477Z","status":"ssl_error","status_checked_at":"2026-04-29T20:22:26.507Z","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":["react","react-component","react-condition","react-switch-case"],"created_at":"2024-11-24T17:14:00.368Z","updated_at":"2026-04-29T21:04:39.078Z","avatar_url":"https://github.com/yyz945947732.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-switch-case-render\n\n\u003e Switch-case React component to render nested components.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\nnpm install --save react-switch-case-render\n```\n\n## Usage\n\n```ts\nimport { Switch, Case, Default } from 'react-switch-case-render';\n\nfunction Example({ expression }) {\n  const type = 'show';\n\n  return (\n    \u003cSwitch expression={type}\u003e\n      \u003cCase value=\"show\"\u003eshow\u003c/Case\u003e\n      \u003cCase value=\"add\"\u003eadd\u003c/Case\u003e\n      \u003cCase value=\"edit\"\u003eedit\u003c/Case\u003e\n      \u003cDefault\u003enothing to show.\u003c/Default\u003e\n    \u003c/Switch\u003e\n  );\n}\n```\n\n### API\n\n#### \\\u003cSwitch /\u003e\n\nThe `\u003cSwitch /\u003e` components provide an expression, matching the expression's value against a series of `\u003cCase /\u003e` components, and render `\u003cCase /\u003e` children after the first `\u003cCase /\u003e` with a matching value.\n\n| Prop       | Type                                 |\n| ---------- | ------------------------------------ |\n| expression | string/number/boolean/null/undefined |\n| children   | React.ReactNode                      |\n\n#### \\\u003cCase /\u003e\n\nprovide an value used to match against expression. if the expression matches the value, the `children` will be render.\n\n| Prop     | Type                                 |\n| -------- | ------------------------------------ |\n| value    | string/number/boolean/null/undefined |\n| children | React.ReactNode                      |\n\n#### \\\u003cDefault /\u003e\n\nif the value of expression doesn't match any of the `\u003cCase /\u003e` value, the `children` will be render.\n\n| Prop     | Type            |\n| -------- | --------------- |\n| children | React.ReactNode |\n\n## LICENSE\n\n[MIT](https://github.com/yyz945947732/react-switch-case-render/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyyz945947732%2Freact-switch-case-render","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyyz945947732%2Freact-switch-case-render","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyyz945947732%2Freact-switch-case-render/lists"}