{"id":22451453,"url":"https://github.com/alexsergey/react-switch-case","last_synced_at":"2025-08-02T00:32:18.732Z","repository":{"id":57346064,"uuid":"64391414","full_name":"AlexSergey/react-switch-case","owner":"AlexSergey","description":"Switch statement in React components","archived":false,"fork":false,"pushed_at":"2023-04-17T09:16:33.000Z","size":1906,"stargazers_count":23,"open_issues_count":4,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-04-24T15:19:11.936Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/AlexSergey.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}},"created_at":"2016-07-28T11:51:47.000Z","updated_at":"2024-06-21T04:19:24.259Z","dependencies_parsed_at":"2024-06-21T04:19:00.404Z","dependency_job_id":"70a5879a-256f-45ae-8983-ccbf66a2a0f9","html_url":"https://github.com/AlexSergey/react-switch-case","commit_stats":{"total_commits":16,"total_committers":3,"mean_commits":5.333333333333333,"dds":0.25,"last_synced_commit":"8b1e0ecc7eb4ba6bfc8bd5b96e4ff2c0848fa1d9"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexSergey%2Freact-switch-case","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexSergey%2Freact-switch-case/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexSergey%2Freact-switch-case/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexSergey%2Freact-switch-case/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlexSergey","download_url":"https://codeload.github.com/AlexSergey/react-switch-case/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228419607,"owners_count":17916772,"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","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":"2024-12-06T06:08:01.042Z","updated_at":"2024-12-06T06:08:01.875Z","avatar_url":"https://github.com/AlexSergey.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Switch Case\n\nLittle switch-case React component to render nested components.\n\n## Usage\n\n### Step 1:\n```sh\nnpm install react-switch-case -save\n```\n\n### Step 2:\n\n```jsx\nimport Switch, { Case, Default } from 'react-switch-case';\n```\n\n### Step 3:\n\n```jsx\nconst componentShow = 'component1';\n\n\u003cSwitch condition={componentShow || (value) =\u003e compare(value)}\u003e\n    \u003cCase value=\"component1\"\u003e\n        \u003cspan\u003eComponent 1\u003c/span\u003e\n    \u003c/Case\u003e\n    \u003cCase value=\"component2\"\u003e\n        \u003cspan\u003eComponent 2\u003c/span\u003e\n    \u003c/Case\u003e\n    \u003cDefault\u003e\n        \u003cspan\u003eNothing!\u003c/span\u003e\n    \u003c/Default\u003e\n\u003c/Switch\u003e\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexsergey%2Freact-switch-case","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexsergey%2Freact-switch-case","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexsergey%2Freact-switch-case/lists"}