expo에서 react-native debugger 사용하기 (redux 디버깅)

2267 단어 reactnativeexpo

개시하다


expo를 사용하여react-native를 개발할 때 디버깅하는 방법은react-native debugger가 있습니다.실제 기기로 동작을 확인할 때의 디버깅 설정이 좀 번거롭기 때문에 총괄해 보겠습니다.주로 레드ux 디버깅입니다.

어플리케이션 설치


react-native debugger 응용 프로그램여기서부터.을 먼저 설치합니다.

node_modules 편집


그다음에 노드.modules/react-native/Libraries/Core/Devtools/setupDevtools.js를 열어 주세요.
52 행의 host 섹션을 편집합니다.Your IP의 경우 현재 연결된 IP 주소를 입력합니다.Mac의 IP 주소는 시스템 환경 설정 → 네트워크 → 상황의 "IP 주소 설정 hogehoge"이다어디?편집후↓

App.js 편집


App.제이스를 이렇게 만든 느낌.

요점
const composeEnhancer = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
네.처음에는 이게 없어서 진행이 잘 안 됐어요.
여기서 끝내도록 설정합니다.

절차.


닫기
  • http://localhost:<port>/debugger-ui
  • react-native debugger 프로그램을 시작하십시오
  • 스마트폰을 사용하는 Debug JS Remotely
  • REACT_DEBUGGER="unset ELECTRON_RUN_AS_NODE && open -g 'rndebugger://set-debugger-loc?port=19001' ||" npm start에서 프로젝트를 시작하십시오.
  • 참고

  • https://github.com/jhen0409/react-native-debugger/blob/master/docs/getting-started.md
  • https://stackoverflow.com/questions/52946133/unable-to-use-react-native-debugger-after-updating-react-native/52953017#52953017
  • 좋은 웹페이지 즐겨찾기