I have been utilizing a Switch component from react-switch in my project.
import Switch from 'react-switch';
render() {
return <Switch
onChange={this.onChangeStatus}
onClick={this.onChangeStatus}
checked={this.state.storeStatus}
offColor="#e8e8e8"
onColor="#62a5f7"
id="storeStatus"/>
}
Despite extensive searching, I have not found a way to customize the default 'X' and 'V' texts to display as 'yes' and 'no' respectively.
While browsing, I came across a similar query on Stack Overflow regarding react-native-switch:
How to show text (YES/NO) inside a switch in react-native
Unfortunately, the solutions provided did not work for me.
I have also perused the documentation but could not find any mention of a parameter that allows customization of the switch text.
https://www.npmjs.com/package/react-switch
https://github.com/markusenglund/react-switch
It seems like such a basic feature should be included. Any suggestions are welcome!