https://github.com/delpikye-v/react-if
React wrapper conditions. Simple wrapper
https://github.com/delpikye-v/react-if
react-condition react-if react-if-else
Last synced: 4 months ago
JSON representation
React wrapper conditions. Simple wrapper
- Host: GitHub
- URL: https://github.com/delpikye-v/react-if
- Owner: delpikye-v
- License: mit
- Created: 2024-10-02T20:08:29.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-25T17:57:46.000Z (over 1 year ago)
- Last Synced: 2025-10-11T15:42:45.604Z (8 months ago)
- Topics: react-condition, react-if, react-if-else
- Homepage: https://www.npmjs.com/package/react-ifz
- Size: 23.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://www.npmjs.com/package/react-ifz)
[](https://standardjs.com)

---
## Description
+ React wrapper conditions
+ If/ElseIf/Else
+ Switch/Case
## Installation
install via npm:
```
npm i react-ifz
```
## Usage
#####
```js
import { Case, Else, ElseIf, If, Switch, Then, When, Default } from 'react-ifz';
const [statez, setStatez] = useState(1);
setStatez(statez + 1)}>Click
// Single => should use this instead of
when: statez === 1
// ****************************************************************
// ****************************************************************
// ****************************************************************
if: statez === 1
if: statez === 2
statez === 3
statez === 4
statez === 5
state other any
// ****************************************************************
// ****************************************************************
// ****************************************************************
Case 7
Case 8
{/*
Case === 9
Case === 10
Case === 11
{/* */}
*/}
// ****************************************************************
Case 7
Case 8
{/*
Case === 9
Case === 10
Case === 11
*/}
{/* */}
```
## Note
```js
// => you should not write condition like this, even if it is supported.
statez === 2: else-if // not rendered
state other 2 // => Render if condtion !==2 and elseIf not true
state other 2 // => Render if condtion !==2
//***** */
// support tag: but you should not use it.
```
## License
MIT