본문 바로가기
  • 컴공생의 공부 일기
  • 공부보단 일기에 가까운 것 같은
  • 블로그
Club|Project/카카오테크 부트캠프 | AI

🌀React Native : 날씨 앱 만들기

by 정람지 2024. 11. 7.

화이팅화이팅! 언니체고


🌀 Snack 사이트

https://snack.expo.dev

 

Snack - React Native in the browser

Write code in Expo's online editor and instantly use it on your phone.

snack.expo.dev


텍스트는 <text> 안에 

웹에서 사용하던 모든 스타일을 사용할 수는 없음

 

StyleSheet.create 사용 효과적 / 또는 object 만들기

 

1. div 사용 불가능/ view를 써야 함

2. 모든 텍스트는 텍스트 컴포넌트 안에 써야 함

3. 원하는 대로 스타일 사용 가능

 

statusBar : 상단 배터리, 와이파이 등 있는  바 

일부 렌더링되는 컴포넌트 중에는 ios,안드로이드 운영체제와 소통하기 위한 것들이 있음.

 

컴포넌트

 

Core Components and APIs · React Native

React Native provides a number of built-in Core Components ready for you to use in your app. You can find them all in the left sidebar (or menu above, if you are on a narrow screen). If you're not sure where to get started, take a look at the following cat

reactnative.dev

api

 

AccessibilityInfo · React Native

Sometimes it's useful to know whether or not the device has a screen reader that is currently active. The AccessibilityInfo API is designed for this purpose. You can use it to query the current state of the screen reader as well as to register to be notifi

reactnative.dev

api는 자바스크립트 코드로 운영체제와 소통

 

 

expo에도 좋은 레퍼런스 존재

 

Reference

Expo is an open-source platform for making universal native apps for Android, iOS, and the web with JavaScript and React.

docs.expo.dev

 

 

app.json

{ "expo": { "name": "YourAppName", "slug": "your-app-slug", "main": "node_modules/expo/AppEntry.js" } }

Expo 프로젝트에서는 App.tsx 또는 _layout.tsx와 같은 파일이 자동으로 진입점
 
 
pagingEnabled 같은 건 스크롤이 자유롭게 되는 걸 막음
expo나 리액트 docs에서 원하는 컴포넌트,api,props, 등등 을 잘 찾아서 쓰기
! 안드로이드, ios 되는 거 구분해서 쓰기

const { granted } = await Location.requestForegroundPermissionsAsync();
Location.requestForegroundPermissionsAsync 내부 granted 변수의 값 가져오기
 
async/await 비동기 처리
 
 

신기

네트워크 동일한 것 연결 주의