Solve Problem/Troubleshooting 38

React Native Flipper 사용 시, Android 에뮬레이터 인식하지 못할 때

해결책 Android SDK location path를 알맞게 변경해주면 된다. 검색 키워드 react native flipper not recognize android emulator 출처 https://stackoverflow.com/questions/71744103/android-emulator-unable-to-connect-to-flipper Android Emulator unable to connect to Flipper I followed the instructions here https://fbflipper.com/docs/getting-started/android-native/#diagnostics. I added the 3 dependencies in build.gradle, and a..

[React Native] 렌더링 수 줄이기 대작전 🔥 : apollo client - useMutation 에 ignoreResults 옵션 사용하기

react native에서 apollo client를 이용한다. 클릭 이벤트가 발생할 때마다 특정 mutation을 호출하는데,이 mutation이 호출될 때마다 재렌더링이 2번 되는 것을 발견했다. 바로 이 mutation이다.62 line에서 return값 배열의 두번째 원소에는 loading, data 등이 들어가는데,mutation을 호출하면 이 loading과 data값이 업데이트되면서 총 2번의 렌더링이 더 진행되는 것이다. 그래서 결과값은 필요없다고 알려주고 재렌더링을 방지하는 옵션이 있지 않을까? 해서 찾아봤는데,역시나 있었다.https://www.apollographql.com/docs/react/data/mutations/#ignoreresults Mutations in Apollo C..

react-native-push-notification 사용 시 주의점 (안드로이드 id)

https://github.com/zo0r/react-native-push-notification GitHub - zo0r/react-native-push-notification: React Native Local and Remote NotificationsReact Native Local and Remote Notifications. Contribute to zo0r/react-native-push-notification development by creating an account on GitHub.github.com이 라이브러리를 사용할 때 주의점이 있다.보다시피 id를 설정할 수 있는데, 한번 지정된 id는 다시 사용하지 않는 것이 좋다.안그러면 이 푸시에 넣은 데이터를 꺼내올 때 예전 id의 데..

[React Native] Admob 보상형 영상 광고 다 보고 X 버튼 클릭 안되는 오류 해결 : 상태바 숨기기!

어느날... 이러한 CS가 왔다.광고를 다 봤는데도 상태바에 가려져서 X버튼을 누르지 못했다는 것!현재 react native에서 보상형 영상 광고를 띄워주기 위해@react-native-firebase/admob: 11.5.0을 사용하고 있다. 서드파티... admob을 원망하며 admob+statusbar를 키워드로 이슈를 찾아봤는데 마땅히 해결책이 없었다.-> 그런데 상태바를 가리는거면.. 상태바를 없애면 되는 문제 아닌가? 싶었다. 당장 react-native에서  StatusBar를 이용해 숨겨보았다.상태바 부분을 터치범위로 두고, 상태바가 있을 때와 없을 때 각각 터치가 가능한 지 실험해보았다.예상한대로, 상태바가 있을 때는 클릭이 가능했고 없을 때는 불가능했다. 위 영상에서 사용한 코드를 첨..

[React Native] linkTo 사용 시, The 'navigation' object hasn't been initialized yet 문제 해결 방법 (react-navigation NavigationContainer 마운팅된 직후를 onReady로 감지하기)

[React Native] linkTo 사용 시, The 'navigation' object hasn't been initialized yet 문제 해결 방법 (react-navigation NavigationContainer 마운팅된 직후를 onReady로 감지하기)특정 페이지에 도달 할 수 있는 링크인 딥링크를 이용하고 있다. 앱이 완전히 닫힌 상태에서 딥링크로 앱을 열면,(Android의 경우) Linking.getInitialURL 로 (iOS의 경우) Linking.addEventListener('url', handleOpenUrl) 로앱을 열게 한 url 장본인(?)을 알 수 있다.(이 글은 Android 기준으로 코드를 작성했습니다.) const url = "roubitapp://root-t..

암호 입력 없이 git push 하기

이미 깃헙에 ssh 올려져 있는데도, 로컬 터미널에서는 git push 시 암호 입력해야하는 경우가 있다. 그런 경우에는, 로컬 ssh-agent에 암호가 등록되어있지 않은 경우다.ssh-agent: SSH 키를 관리하고 키를 사용할 때마다 암호를 입력하지 않도록 도와주는 프로그램. eval "$(ssh-agent -s)"ssh-add ~/.ssh/id_rsa이렇게 하면 등록 완료! 이제 로컬에서 git push 마다 암호를 입력하지 않아도 된다.

dayjs.tz() 사용 시 주의할 점: timezone 등록 (Android Hermes)

react native에서 날짜 관련 코드를 다룰 때, dayjs 라이브러리를 사용하고 있다. 등록되지 않은 timezone 한국 시간으로 고정시켜주고 싶어서 다음 코드를 사용했는데, import dayjs from 'dayjs'; import DayJSUtc from 'dayjs/plugin/utc'; import DayJSTimezone from 'dayjs/plugin/timezone'; dayjs.extend(DayJSUtc); dayjs.extend(DayJSTimezone); const time = dayjs.tz("2023-02-17 09:00:00", "Asia/Seoul"); RangeError: com.facebook.hermes.intl.JSRangeErrorException: Inv..

Github Action 오류 해결 : InvalidParameterValue

첫번째 InvalidParameterValue 오류 An error occurred (InvalidParameterValue) when calling the UpdateEnvironment operation: Environment named xxx is in an invalid state for this operation. Must be Ready. 환경 상태가 ok가 아닌 다른 상태면 github action 도중 오류가 나는 것 같다. 사진처럼 ok 상태일 때 배포를 다시 진행해보자! 두번째 InvalidParameterValue 오류 An error occurred (InvalidParameterValue) when calling the UpdateEnvironment operation: No Ap..

에러해결: PayloadTooLargeError: request entity too large

AWS 로그를 뜯어보던 중... 다음 에러를 발견했다. PayloadTooLargeError: request entity too large 그대로 구글링하니 해결법은 쉬웠다. 파싱하려는 데이터의 크기가 너무 크기 때문에 생기는 에러이며, 파싱할 수 있는 최대치를 늘려주면 해결된다. 기본은 100kb인데, 50mb까지 늘려주었다. import { urlencoded, json } from 'body-parser'; app.use(json({ limit: '50mb' })); app.use(urlencoded({ limit: '50mb', extended: true })); body-parser란? - 요청의 본문을 해석해주는 미들웨어다. - post, put 요청 메소드의 request.body를 읽어올 ..

[ReactNative] KeyboardAvoidingView 안에 여러 TextInput을 사용할 때 offset 맞지 않는 문제 해결

[ReactNative] KeyboardAvoidingView 안에 여러 TextInput을 사용할 때 offset 맞지 않는 문제 해결 하나의 KeyboardAvoidingView 안에서 여러 TextInput을 사용하면 keyboardVerticalOffset이 첫 TextInput에 맞춰 세팅되어, 키보드 높이가 다른 TextInput을 만나게 되면 KeyboardAvoidingView 본래의 목적을 충족시키지 못하는 현상이 발생한다. 코드는 이렇고, {isStep1 && ( )} {isStep2 && ( )} {isStep3 && ( )} 현상은 이렇다. 분명 공식문서 에는

출처: https://mingos-habitat.tistory.com/34 [밍고의서식지:티스토리]