react-switch_case
v1.0.1
Published
react switch
Downloads
8
Readme
react-switchCase
- npm install react-switch_case or yarn add react-switch_case
import Switch from 'react-switch_case'
const Case=Switch.Case
function handle(value){
return ['3','4','5'].includes(value)
}
<Switch value="1">
<Case value="1" style={{color:'red'}}>aaa</Case>
<Case value="2">aaa</Case>
{
//value can be a function
}
<Case value={handle}>aaa</Case>
{
//default
}
<span>default case</span>
</Switch>