본문 바로가기

React-Native

(7)
[j React-Native] Platform & DeviceInfo 정보 가져오기 1. Platform 정보 import { Platform, View, } from 'react-native'; Platform.OS -> ios or android Platform.Version -> version 2. DeviceInfo - 설치 npm install --save react-native-device-info or using yarn: yarn add react-native-device-info ex) - DeviceInfo.getBrand() -> 브랜드 정보 - DeviceInfo.isTablet() -> 태블릿인지 아닌지 더 많은 정보는 해당 사이트에 표로 정리가 되어있다. https://github.com/react-native-device-info/react-native-dev..
[j React-native] TS~~ error 발생시 해결 빌드는 잘 되는데 빨간 줄 뜨고 TS~~ 라고 시작하는 에러가 발생하면 Typescript 에러이다. 구글에 해당 에러를 검색 후 해결하면 된다.
[j React-Native] Animated: `useNativeDriver` was not specified issue of ReactNativeBase Input 이슈 해결 Animated: `useNativeDriver` was not specified issue of ReactNativeBase Input 해당 이슈가 발생하면 useNativeDriver: false or true 한 줄을 추가해 주면 된다. ex) Animated.timing(this.state.mySquare, {//opacity효과 toValue: 0, duration: 2000, delay: 1500, //1.5초후 동작 useNativeDriver: false }).start();
[j React-Native] Slider (react-native-slider) React Native 에서 Slider 기능을 추가해보자. 1. Slider 설치 yarn add @react-native-community/slider or npm install @react-native-community/slider --save 2. import import Slider from '@react-native-community/slider'; 3. Slider 추가 4. Slider 값 바꿔주기 (.js) state = { value:50 //초기 값 } sliderValueChange =(value) => { this.setState({ value: value }) } {this.state.value} 더 많은 옵션을 추가하고 싶으면 참고 사이트에서 참고해 추가하면 된다. ** 참고 ..
[j React-Native] Multiple commands produce Error 해결하기 xcode 빌드 시 Multiple commands produce error가 난다면 해당 방법으로 해결 할 수 있다. 1. 해당 위치에서 Multiple commands produce ~~ 이후에 로그에 찍히는 파일을 삭제해준다. Copy Bundle Resoures에서 삭제 2. clear build -> build 해줌
[j React Native] Drawer Navigator DrawerNavigator 구현해보자. (mac환경) 1. 패키지 설치 yarn add @react-navigation/drawer yarn add react-native-gesture-handler yarn add react-native-reanimated 2. ios pod install npx pod-install 3. App.js 구현 import React,{Component} from 'react'; import {NavigationContainer} from '@react-navigation/native'; import {createDrawerNavigator} from '@react-navigation/drawer'; import {View, Text, Button,StyleSheet} ..
[j React Native]Command `run-ios` error npm install --save react-native@latest sudo npm install -g react-native-cli --force 설치 후 실행 react-native run-ios