https://github.com/alexsergey/react-switch-case
Switch statement in React components
https://github.com/alexsergey/react-switch-case
Last synced: 11 months ago
JSON representation
Switch statement in React components
- Host: GitHub
- URL: https://github.com/alexsergey/react-switch-case
- Owner: AlexSergey
- Created: 2016-07-28T11:51:47.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2023-04-17T09:16:33.000Z (about 3 years ago)
- Last Synced: 2024-04-24T15:19:11.936Z (about 2 years ago)
- Language: JavaScript
- Size: 1.82 MB
- Stars: 23
- Watchers: 5
- Forks: 3
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# React Switch Case
Little switch-case React component to render nested components.
## Usage
### Step 1:
```sh
npm install react-switch-case -save
```
### Step 2:
```jsx
import Switch, { Case, Default } from 'react-switch-case';
```
### Step 3:
```jsx
const componentShow = 'component1';
compare(value)}>
Component 1
Component 2
Nothing!
```
## License
MIT