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 (); }; export default Setting; SOUND sub'sBlog
'개발연습막쓰기 > React 개발연습 막쓰기' 카테고리의 다른 글
RN ios, android 디바이스별 폰트 설정 관련 (0) | 2020.08.26 |
---|---|
RN 애러 (0) | 2020.08.25 |
map (0) | 2020.08.03 |
[React Native Error] pod install 후 발생하는 에러 해결 방법 (0) | 2020.07.25 |
react native gradient (0) | 2020.07.24 |