# jsx-switch

> Simple switch statements for React JSX

Latest version **0.0.3** (published 2016-08-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install jsx-switch
pnpm add jsx-switch
yarn add jsx-switch
bun add jsx-switch
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2016-08-05 |
| First published | 2016-08-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Rudi Yardley |
| Maintainers | ryardley |
| Keywords | switch, react, jsx, case, switch case, react case statement, case switching react, switch case for react, switch statements for react |

## Links

- npm: https://www.npmjs.com/package/jsx-switch
- Repository: https://github.com/ryardley/jsx-switch
- Homepage: https://github.com/ryardley/jsx-switch#readme
- Issues: https://github.com/ryardley/jsx-switch/issues
- npm.io page: https://npm.io/package/jsx-switch

## Dependencies (2)

- [react](https://npm.io/package/react.md) ^15.0.0
- [react-dom](https://npm.io/package/react-dom.md) ^15.0.0

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 0.0.3 (latest) — 2016-08-05
- 0.0.2 — 2016-08-05

## README

<img src="https://travis-ci.org/ryardley/jsx-switch.svg?branch=master" />

# jsx-switch

Simple switching for React JSX

Found a bug? Got a feature request? [Submit an issue!](https://github.com/ryardley/jsx-switch/issues)

# Installation

Install locally.

```bash
$ npm install jsx-switch --save
```

Requires React 15.0.0 or later.

# Usage

```jsx
import { Switch, Case, Default } from 'jsx-switch';

function MyComponent() {
  return (
    <Switch>
      <Case expr={...}>
        <Component1 />
      </Case>
      <Case expr={...}>
        <Component2 />
      </Case>
      <Case expr={...}>
        <Component3 />
      </Case>
      <Default>
        <Component4 />
      </Default>
    </Switch>
  );
}
```

---
_Source: https://npm.io/package/jsx-switch · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
