Django & React-Native: pure RN vs. Expo?

Shawnpy·2021년 9월 22일
1

Django & React-Native

목록 보기
3/14

React Native Documentation also reconmmends Expo for new mobile developers to start. As it was not clear enough to compare Expo and pure React Native by reading resources, I used them all during studying RN tutorial.

Expo uses third party program, when we read the QR code after the app build with mobile Expo app, the current developing app shows on mobile screen. Packages in directory have been automatically organized, and useful icon libraries have already been offered.

Since using pure RN with cli, additional work was necessary to work on physical Android phone + Windows 10 such as path environment settings. Still, thanks to all instruction in RN documentation, it was not difficult to follow the steps.

After finishing all the environment settings, with the mobile screen on active, building completes when we write the following two cli lines to connect the pc codes and the mobile app screen.

*** each lines need to be written on the different cli(ex. git bash) screens.
$ npx react-native start
$ npx react-native run-android

"$ start" screen shows error contents after every code changes by refresh(=save).
"$ run-android" screen can be used to write other commands after the first mobile app build. I mostly used this screen for git add/commit purpose.
However, after installing new libraries, those two commands need to be newly written once again to avoid import errors.


React Native Documentation에서도 첫 모바일 입문 개발자에게는 Expo를 사용하여 개발을 시작하도록 조언한다. 둘 중에 무엇이 차이가 있는지 글로 이해하는 데 한계가 있어, RN tutorial을 공부할 때 둘 다 사용해 보았다.

Expo는 제3자 프로그램을 사용하여, 빌드 후 생성된 QR코드를 모바일에서 Expo 앱으로 촬영하면 해당 개발중인 앱이 모바일에 구현된다. 디렉토리 내에 패키지도 알아서 정리되어 있고, 아이콘 라이브러리 등 Expo를 통해 제공되는 이점들이 존재했다.

순수한 RN cli로 모바일 제작을 해보니, 물리적인 실제 Android phone + 윈도우10인 본인의 컴퓨터에서 path 설정 등의 추가 작업이 조금 더 필요했다. 그래도 RN 문서에 친절히 모든 내용이 안내되어 있어, 따라가기에 큰 어려움은 없었다.

모든 환경 설정이 끝난 뒤, 실제 모바일의 화면만 활성화로 둔 채, 다음 두 코드를 작성하면 모바일 앱과 컴퓨터 내 코드가 연결되어 빌드가 완성된다.

*** 각자 다른 cli(ex. git bash) 창에서 코드를 작성해야 한다.
$ npx react-native start
$ npx react-native run-android

"$ start" 창에서는 코드 수정 후 새로고침 시마다 오류 발생 시, 에러 내용을 보여준다.
"$ run-android" 창에서는 첫 모바일 앱 시작할 때 한 번 빌드가 완료되면, 다른 command 작성이 가능하니, 주로 git add/commit 용도로 사용하면 편리하다.
단, 새로운 library를 다운로드 한 뒤에는 두 명령어를 새로 한 번씩 다시 command 해주어야 에러가 발생하지 않는다.

profile
Do what you feel now

0개의 댓글