본문 바로가기

react native13

[React Native] SVG 파일 사용 시, 터치이벤트 이슈 react-native-svg를 이용하여 svg파일을 컴포넌트로 적용으로 성공하였으나 이벤트를 주려고 하니 문제가 발생하였다. iOS만;; command + d를 눌러 Show Inspector로 확인해보니 영역을 이상하게 잡고 있는 부분이 확인되었다 구글신에게 물어보니 2가지 해결책을 제시해 준다 1. pointerEvents="none" function SvgComponent() { return ( // Svg 컴포넌트 ) } 2. overflow: hidden function SvgComponent() { return ( // Svg 컴포넌트 ) } 속성에 대한 정보는 직접 찾아보기로 하고 일단 여기까지 끝. 2022. 4. 5.
[React Native] android react-native-reanimated 에러 정상 작동하다가도 써드파티 라이브러리의 갑작스러운 에러는 이제 익숙하다(예견된 에러일지도...) 아래는 처음 프로젝트 생성시 추가되어 있던 dependencies의 react-native-reanimated 에러이다 attempt to invoke interface method boolean com.swmansion.reanimated.layoutReanimation.NativeMethodsHolder.isLayoutAnimationEnabled on a null object reference 일단 package.json의 상태를 확인해보자 react 17.0.2 react-native 0.65.1 react-native-reanimated 2.1.0 이렇게였고 github을 확인해보니 https://g.. 2022. 2. 1.
[React Native] 명령어로 실행시, iOS Simulator 설정 간단하지만 몰라도 Xcode에서 직접 실행해도 된다 하지만 우리는 명령어로 실행시키고 싶기 때문에, 우선 Simulator의 종류를 찾아보자. Xcode를 실행 후 Window > Devices and Simulators를 선택하면 새로운 창이 뜨고 Simulators 탭을 클릭하면 여러 종류가 있는 것을 확인할 수 있다 명령어로 실행시키고 싶은 Simulator를 마음속으로 정한 후 package.json의 기본 설정에 보면 scripts에 ios부분이 있다 "scripts": { "android": "react-native run-android", "ios": "react-native run-ios --simulator \"iPhone 12\"", "start": "react-native start".. 2022. 2. 1.
[React Native] iOS 실행시 에러(arm64 관련) m1 맥북 Xcode: 12.4 react: "17.0.1" react-native: "0.64.1" React Native로 iOS나 aOS를 빌드할 때 발생하는 에러를 가볍게 무시하면 엄청난 삽질을... 개발을 진행하다 이런 에러를 만났다 The linked library 'libPods-xxx.a' is missing one or more architectures required by this target: arm64. 딱 이 에러를 만났을 때 다른 짓(?) 하지 말고 바로... Build Settings > Architectures로 이동하여 그림처럼 arm64를 추가해주고 다시 빌드하면 성공! 끝. 2021. 5. 9.
[React Native] .jsx 확장자 사용시 에러 및 설정 방법 프로젝트를 생성하고 .js 파일만으로도 충분히 개발이 가능하다 하지만 개발시 명시적인게 좋아서 JSX 파일에 .jsx 확장자를 사용하고 설정하는 방법을 알아보자 일단 프로젝트를 새로 생성 후 보이는 App.js 파일을 App.jsx로 바꾸고, npx react-native start npx react-native run-ios yarn이 설치되어 있다면 npx대신 사용해도 된다 Metro와 Application을 다시 실행해보면 에러가 발생한다 에러메시지 중, None of these files exist라고 나오면서 .jsx로 바꾼 파일명 뒤에 (.native|.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios... 2021. 3. 14.