{"id":28279272,"url":"https://github.com/delpikye-v/react-if","last_synced_at":"2026-01-25T11:31:43.319Z","repository":{"id":257808835,"uuid":"866752484","full_name":"delpikye-v/react-if","owner":"delpikye-v","description":"React wrapper conditions. Simple wrapper","archived":false,"fork":false,"pushed_at":"2024-10-25T17:57:46.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-11T15:42:45.604Z","etag":null,"topics":["react-condition","react-if","react-if-else"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/react-ifz","language":null,"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/delpikye-v.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,"zenodo":null}},"created_at":"2024-10-02T20:08:29.000Z","updated_at":"2024-10-25T17:57:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"31d74cd7-002c-43c4-b096-4f09f19b8f39","html_url":"https://github.com/delpikye-v/react-if","commit_stats":null,"previous_names":["delpikye-v/react-if"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/delpikye-v/react-if","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delpikye-v%2Freact-if","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delpikye-v%2Freact-if/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delpikye-v%2Freact-if/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delpikye-v%2Freact-if/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/delpikye-v","download_url":"https://codeload.github.com/delpikye-v/react-if/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delpikye-v%2Freact-if/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28752668,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T10:25:12.305Z","status":"ssl_error","status_checked_at":"2026-01-25T10:25:11.933Z","response_time":113,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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-condition","react-if","react-if-else"],"created_at":"2025-05-21T09:14:19.073Z","updated_at":"2026-01-25T11:31:43.313Z","avatar_url":"https://github.com/delpikye-v.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003ch1\u003ereact-ifz\u003c/h1\u003e\n    \u003ca href=\"https://www.npmjs.com/package/react-ifz\"\u003ereact-ifz\u003c/a\u003e\n    \u003cbr /\u003e\n    \u003cbr /\u003e\n    \u003cb\u003e\u003ca href=\"https://codesandbox.io/p/sandbox/2xn6yw\"\u003eLIVE EXAMPLE\u003c/a\u003e\u003c/b\u003e\n\u003c/div\u003e\n\n\u003cbr /\u003e\n\n[![NPM](https://img.shields.io/npm/v/react-ifz.svg)](https://www.npmjs.com/package/react-ifz)\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n![Downloads](https://img.shields.io/npm/dt/react-ifz.svg)\n\n---\n## Description\n+ React wrapper conditions\n+ If/ElseIf/Else\n+ Switch/Case\n\n## Installation\n\ninstall via npm:\n```\nnpm i react-ifz\n```\n\n## Usage\n\n#####\n```js\nimport { Case, Else, ElseIf, If, Switch, Then, When, Default } from 'react-ifz';\n\nconst [statez, setStatez] = useState(1);\n\n\u003cbutton onClick={() =\u003e setStatez(statez + 1)}\u003eClick\u003c/button\u003e\n\n// Single =\u003e should use this instead of \u003cIf /\u003e\n\u003cWhen condition={statez === 1}\u003e\n    when: statez === 1\n\u003c/When\u003e\n\n// ****************************************************************\n// ****************************************************************\n// ****************************************************************\n\n\u003cIf condition={statez === 1}\u003e\n    if: statez === 1\n\u003c/If\u003e\n\n\u003cIf condition={statez === 2}\u003e\n    \u003cThen\u003eif: statez === 2\u003c/Then\u003e\n\n    \u003cElseIf condition={statez === 3}\u003e\n        statez === 3\n    \u003c/ElseIf\u003e\n\n    \u003cElseIf condition={statez === 4}\u003e\n        statez === 4\n    \u003c/ElseIf\u003e\n\n    \u003cElseIf condition={statez === 5}\u003e\n        statez === 5\n    \u003c/ElseIf\u003e\n\n    \u003cElse\u003estate other any\u003c/Else\u003e\n\u003c/If\u003e\n\n// ****************************************************************\n// ****************************************************************\n// ****************************************************************\n\u003cSwitch\u003e\n    \u003cCase condition={statez === 7}\u003e\n        Case 7\n    \u003c/Case\u003e\n    \u003cCase condition={statez === 8}\u003e\n        Case 8\n    \u003c/Case\u003e\n    {/*\n    \u003cCase condition={statez === 9}\u003eCase === 9\u003c/Case\u003e\n    \u003cCase condition={statez === 10}\u003eCase === 10\u003c/Case\u003e\n    \u003cCase condition={statez === 11}\u003eCase === 11\u003c/Case\u003e\n    {/* \u003cDefault /\u003e */}\n    */}\n\u003c/Switch\u003e\n\n// ****************************************************************\n\u003cSwitch condition={prop.value}\u003e\n    \u003cCase condition={7}\u003e\n        Case 7\n    \u003c/Case\u003e\n    \u003cCase condition={8}\u003e\n        Case 8\n    \u003c/Case\u003e\n    {/*\n    \u003cCase condition={9}\u003eCase === 9\u003c/Case\u003e\n    \u003cCase condition={10}\u003eCase === 10\u003c/Case\u003e\n    \u003cCase condition={11}\u003eCase === 11\u003c/Case\u003e\n    */}\n    {/* \u003cDefault /\u003e */}\n\u003c/Switch\u003e\n\n```\n\u003cbr /\u003e\n\n## Note\n```js\n// =\u003e you should not write condition like this, even if it is supported.\n\u003cIf condition={statez === 2}\u003e\n    \u003cElseIf condition={statez === 2}\u003e\n        statez === 2: else-if // not rendered\n    \u003c/ElseIf\u003e\n\n    \u003cElse\u003e\n        state other 2  // =\u003e Render if condtion !==2 and elseIf not true\n    \u003c/Else\u003e\n\u003c/If\u003e\n\n\u003cIf condition={statez === 2}\u003e\n    \u003cElse\u003estate other 2\u003c/Else\u003e  // =\u003e Render if condtion !==2\n\u003c/If\u003e\n\n//***** */\n// support tag: but you should not use it.\n\u003cSwitch\u003e\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdelpikye-v%2Freact-if","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdelpikye-v%2Freact-if","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdelpikye-v%2Freact-if/lists"}