목록React Native (6)
가수면
컴퓨터 메모리 부족 문제 Error occurred during initialization of VM Could not reserve enough space for 2097152KB object heap JVM에 할당하기 위한 컴퓨터 메모리가 부족하다는 오류이다.이 경우 컴퓨터의 여유 메모리를 확보하든가, gradle.properties의 설정을 통해 JVM에 할당하는 메모리를 줄여야한다.// android/gradle.propertiesorg.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m-Xmx2048m: 이 옵션은 JVM에 할당할 수 있는 최대 메모리 양-XX:MaxMetaspaceSize=512m: 타스페이스에 사용할 수 있는 최대 메모리. 메타스페이스..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/d6OyiM/btsHec6ze7T/kG0wTF3qN98pP6Ztb2opbK/img.png)
React Native를 위한 안드로이드 스튜디오 설치 및 세팅https://reactnative.dev/docs/environment-setup Setting up the development environment · React NativeThis page will help you install and build your first React Native app.reactnative.devhttps://developer.android.com/studio/run/emulator-acceleration Configure hardware acceleration for the Android Emulator | Android Studio | Android DevelopersDiscover how the ..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/BI48D/btr3fuxG9Zi/FKJtGvfNNstfHgDvxv1vZK/img.png)
리액트 네이티브에서 context를 사용하다가 아래와 같은 오류를 만나버렸다.. Require cycle: src\components\Calendar\CalendarContainer.jsx -> src\components\Calendar\Day.jsx -> src\components\Calendar\CalendarContainer.jsx Require cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle. 아래는 해당 코드다. CalendarContainer.jsx export const CalendarContext = createContext({}); con..
CSS paddingHorizontal과 paddingVertical이라는 속성이 존재함 버튼 Text태그에 TouchableOpacity, TouchableHighlight, TouchableWithoutFeedback 등을 import해서 사용 이때 onClick 기능을 onPress가 대신함 ※ 위 3가지 태그들은 간편하지만 Pressable이 확장성면에서는 더 유용함. 이미지 Image 태그를 사용함. 그러나 최적화나 지원하지 않는 형식이 있는 등의 한계가 있음. react-native-fast-image 패키지를 사용하면 FastImage 컴포넌트를 통해 캐싱, 로딩스피너 제공 등 최적화가 가능함
StyleSheet.create 스타일 자동 완성 기능 const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: '#fff', alignItems: 'center', justifyContent: 'center', }, }); 삭제하고 아래처럼 써도 되지만 자동완성이 되지 않는다. const styles = { container: { flex: 1, backgroundColor: '#fff', alignItems: 'center', justifyContent: 'center', }, };
Expo CLI 설치 npm install --global expo-cli Watchman 설치(Mac용) brew update brew install watchman 프로젝트 설치 expo init my-app expo init my-app --npm (npm으로 설치) 로그인 expo login 실행 npm start expo start expo start --tunnel (오류 뜰 때 이걸로 실행하면 됨) npx expo start --tunnel qr배포 expo publish app배포 https://docs.expo.dev/build/setup