1.5.1 • Published 5 years ago

react-switch-case v1.5.1

Weekly downloads
339
License
MIT
Repository
github
Last release
5 years ago

React Switch Case

Little switch-case React component to render nested components.

Usage

Step 1:

npm install react-switch-case -save

Step 2:

import Switch, { Case, Default } from 'react-switch-case';

Step 3:

const componentShow = 'component1';

<Switch condition={componentShow || (value) => compare(value)}>
    <Case value="component1">
        <span>Component 1</span>
    </Case>
    <Case value="component2">
        <span>Component 2</span>
    </Case>
    <Default>
        <span>Nothing!</span>
    </Default>
</Switch>

License

MIT

1.5.1

5 years ago

1.5.0

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

8 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago