1renderSwitch(param) {
2 switch(param) {
3 case 'foo':
4 return 'bar';
5 default:
6 return 'foo';
7 }
8}
9
10render() {
11 return (
12 <div>
13 <div>
14 // removed for brevity
15 </div>
16 {this.renderSwitch(param)}
17 <div>
18 // removed for brevity
19 </div>
20 </div>
21 );
22}
1> npm i bootstrap-switch-button-react --save
2
3import BootstrapSwitchButton from 'bootstrap-switch-button-react'
4
5<BootstrapSwitchButton
6 onlabel='Hide'
7 onstyle='danger'
8 offlabel='Show'
9 offstyle='success'
10 style="border"
11 width={80}
12 onChange={() => {
13 handleReload()
14 }} />
15 <label> Show Hide Switch Button </label>
16