개발/react-native 7

[react-native] 오류 : Unable to load script. Make sure youre dither running a Metro server...

react-native 최초 설치 후 안드로이드 스튜디오로 실행할 경우 위와 같은 오류 발생할때 1. [패키지명]/android/app/src/main/assets 폴더가 있는지 확인하고 없으면 생성 2. [패키지명]/android 폴더에서 ./gradlew clean 실행 3. [패키지명] 폴더에서 아래 명령어 실행 react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res 4. react-native run-android 참고 https://dev..

개발/react-native 2019.07.18

[react-native][expo] 시작하기

1. expo 설치 npm install -g expo-cli 2. 프로젝트 생성 expo init projectName 3. 빌드 expo build:android expo build:ios * 모듈설치 후 실행 react-native link 4. 네이티브코드로 변환 expo eject https://docs.expo.io/versions/latest/expokit/eject/ Ejecting to ExpoKit - Expo Documentation ExpoKit is an Objective-C and Java library that allows you to use the Expo platform and your existing Expo project as part of a larger standar..

개발/react-native 2019.07.04

[react-native] LifeCycle API

LifeCycle API constructor constructor(props){ super(props); console.log("constructor"); } 생성자 메소드로서 컴포넌트가 처음 만들어 질 때 실행됩니다. 이 메소드에서 기본 state 를 정할 수 있습니다. componentWillMount componentWillMount(){ console.log("componentWillMount"); } 컴포넌트가 DOM 위에 만들어지기 전에 실행됩니다. render 컴포넌트 렌더링을 담당합니다. componentDidMount componentDidMount(){ console.log("componentDidMount"); } 컴포넌트가 만들어지고 첫 렌더링을 다 마친 후 실행되는 메소드입니다...

개발/react-native 2019.05.21