I am implementing custom toggleSwitch in react native.I am new in react native. I gone through below link but I am not able achieve the implement.
https://www.digitalocean.com/community/tutorials/how-to-build-a-custom-toggle-switch-with-react
I also check https://dev.to/narendersaini32/how-to-create-custom-toggle-button-in-react-387m
Login.js
import React from 'react'; import styles from './style'; import { SafeAreaView, View, Switch } from "react-native"; class Login extends React.Component { render() { return ( <SafeAreaView> <View style={styles.container}> </View> <View> <ToggleComponent/> //I want to import here toggleSwitch </View> </View> </SafeAreaView> ) } } export default Login;
ToggleButton.js
import React from 'react'; const ToggleComponent = ({}) => ( *****************??************** ); const styles = StyleSheet.create({ }) export default ToggleComponent;
I want to implement custom ToggleSwitch.
import this component in your file where you want to use it.
import ToggleComponent from "../location_of_ToggleComponent.js"
and then you can use it like any other component.
<ToggleComponent />
1.4m articles
1.4m replys
5 comments
57.0k users