1import { Switch } from 'react-native-paper';
2
3const MyComponent = () => {
4 const [isSwitchOn, setIsSwitchOn] = React.useState(false);
5
6 const onToggleSwitch = () => setIsSwitchOn(!isSwitchOn);
7
8 return <Switch value={isSwitchOn} onValueChange={onToggleSwitch} />;
9};