react switch component
npm install jb-switch-reactnpm install jb-switch-react to install package with npm
import {JBSwitch} from 'jb-switch-react'
jsx
onChange(e)} >
`
as you can see in above example value is on-way binding like normal react forms input trueTitle is a title that place on true side of component and get bold on value == true onChange is standard too
if you want to show loading in switch just make isLoading = true
`javascript
onChange(e){
setIsLoading(true)
return new Promise((resolve,reject)=>{
fetch(request).then((response)=>return response.json).then((data)=>{
setIsLoading(false)
resolve();
})
})
}
``