react-switch-case-module

2.0.7 • Public • Published

React Switch Case Module

Switch component to easy make conditional rendering

First install the package:

npm install react-switch-case-module

And import the module:

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

Then you can use it:

<Switch 
    componentName={'HelloComponent'} 
    defaultComponent={<div>Default component</div>}
>
    <Case value={'HelloComponent'}><div>Hello</div></Case>
    <Case value={'ByeComponent'}><div>Bye</div></Case>
</Switch>

Readme

Keywords

Package Sidebar

Install

npm i react-switch-case-module

Weekly Downloads

1

Version

2.0.7

License

ISC

Unpacked Size

5.76 kB

Total Files

7

Last publish

Collaborators

  • adrihm