Cute
0
Q:

switch in react

renderSwitch(param) {
  switch(param) {
    case 'foo':
      return 'bar';
    default:
      return 'foo';
  }
}

render() {
  return (
    <div>
      <div>
          // removed for brevity
      </div>
      {this.renderSwitch(param)}
      <div>
          // removed for brevity
      </div>
    </div>
  );
}
0
> npm i bootstrap-switch-button-react --save

import BootstrapSwitchButton from 'bootstrap-switch-button-react'

<BootstrapSwitchButton 
      				onlabel='Hide'
                    onstyle='danger'
                    offlabel='Show'
                    offstyle='success'
					style="border"
                    width={80}
                    onChange={() => {
                        handleReload()
                    }} />
                    <label> Show Hide Switch Button </label>
0

New to Communities?

Join the community