Develop/React Native 5

[React Native] 이미지 성능 이슈

[React Native] Perfomance Issue with Image There is a screen that shows several items as a list. Each item has an image of thumbnail. There is no problem with the iPhone, but there is a serious slowdown in Android. The solutions found while doing various things are as follows. 여러 항목을 리스트로 보여주는 화면이 있다. 각 항목에는 두미에 이미지가 있다. 아이폰에서는 문제가 없는데 안드로이드에서는 심각하게 느려지는 현상이 발생했다. 여러가지 해보면서 찾은 해결법은 아래와 같다. 1. Im..

[React] Context 를 이용한 전역 데이터 관리

- 해당 내용은 React Native를 개발하면서 작성했으나 React에도 똑같이 적용할 수 있는 내용 - useContext example 필자가 React Native를 이용해서 현재 위치를 기반으로 리스트의 각 아이템별로 데이터를 업데이트 해줘야하는 상황이었다. 단순히 각 아이템 마다 위치정보를 구독하고 계산해서 업데이트하려니 상당히 지저분하고 여러개가 구독하고 있는 괴상한 구조가 되었다. 목표는 단일 구독으로 전체 앱에서 위치정보를 공유할 수 있도록 하는 것. 하루종일 헛짓하다가 시도한 방법은 아래와 같다. 1. useLocation이라는 hook을 만들기 -> 코드만 분리될 뿐 실상은 똑같다. 2. hook을 싱글톤 처럼 쓰기 -> 그냥 실패. 될리가 없었다.... 3. Redux로 관리 ->..

[React Native] How to fix pod install error with missing compatible arch

If you got an error like below: LoadError - dlopen(/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0/lib/ffi_c.bundle, 0x0009): missing compatible arch in /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0/lib/ffi_c.bundle - /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0/lib/ffi_c.bundle It's maybe occured by M1 Chip on your mac. So, the solution is very simple. Just run 'pod install' as Intel. sudo arch -x86_64 gem ins..

반응형