useState 적용

useState 적용



토글 스위치  


import React , { useState } from 'react'
import {Image, StyleSheet, Text, TouchableOpacity, View, TextInput, } from 'react-native';
import assets from "../../../assets";

import {useNavigation} from "@react-navigation/core";



const styles = StyleSheet.create({});



const Setting = (props) => {
  const navigation = useNavigation();

  const [isEnabled, setIsEnabled] = useState(true);
  const toggleSwitch = () => {
    setIsEnabled(isEnabled => !isEnabled);
  };



  return (
    
      
        SOUND
        
          
        
      
    
  );
};

export default Setting;

sub's
Blog