본문 바로가기
728x90
반응형

모바일앱/react-native3

react lifecycle method 정리 with react-native -1 (componentDidMount, shouldComponentUpdate, componentDidUpdate, componentWillUnmount) * 컴포넌트가 생성될때 다음과 같은 순서로 함수가 호출됩니다. constructor() static getDerivedStateFromProps() render() componentDidMount() 우리는 component관련된 method에 대해 알아볼것입니다. 1. componentDidMount lifecycle method - 컴포넌트가 첫 마운트된 직후 (react component가 생성된후), 즉 트리에 삽입된 직후에 호출됩니다. 대부분 ajax 같은 외부에서 데이터를 가져올때 사용한다. export default class MyComponent extends Component{ constructor() { super(); this.state = {loading:true,data:{}} }.. 2023. 2. 23.
android react native 실행하는법 안드로이드 스튜디오를 실행한뒤 sdk manager를 클릭한다 그후 위와 같이 Android SDK Platform 28 Intel x86 Atom System Image Google APIs Intel x86 Atom System Image Google APIs Intel x86 Atom_64 System Image 내용들을 설치해준다. 1.react-native 프로젝트 생성 및 확인 react-native는 버전에 따라 잘 동작하던 앱이 동작하지 않을수도있기에 React-native로 앱 개발을 할땐 아래에 npm명령어를 통해 버전을 고정시켜 사용해야하는것을 권장한다. 그후 react-native init 을 통해 test1이라는 프로젝트를 실행한다. 그후 usb로 핸드폰과 연결시킨후 npm run.. 2021. 3. 7.
React Native 설치 및 환경설정 -windows 1. node js 설치 nodejs.org/ko/ Node.js Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. nodejs.org 일단 위 경로로 들어간뒤 Nodejs를 설치한다. 필자는 window의 설치했으며 v14.15.4 버젼 노드를 사용하고있다. 2. npm 설치 npm은 node package manager 로 nodejs환경에서 사용할수있는 패키지들을 자유롭게 사용할수있도록 도움을 주는 시스템이다. 3. open jdk 설치 www.azul.com/downloads/zulu-community/?version=java-8-lts&os=windows&architecture=x86-64-bit&package=jd.. 2021. 3. 7.
728x90
반응형