1.5.1 • Published 4 years ago

react-switch-case v1.5.1

Weekly downloads
339
License
MIT
Repository
github
Last release
4 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

4 years ago

1.5.0

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago