본문 바로가기
REACT-NATIVE

리액트 네이티브 03 - Todo App 구조 잡기

by 일태찡 2023. 10. 15.

확장 프로그램 추천(시작하기 전)

리액트 코드 스니펫

 

리액트 코드를 빠르게 작성할 수 있게 도와준다. (물론 네이티브도)

 

 

파일을 만들고 위와 같이 `rnfes`를 치고 엔터를 누르면

 

 

기초 틀이 잡힌 네이티브 코드가 나온다.

 

코드 문법 체크

 

 

위와 같이 코드 오타도 물결 표시로 체크받을 수 있다.

진작에 알았다면 ~

 

Core Components

최대한 네이티브 Core Component를 많이 활용할 것이며 다음의 공식 문서 링크에서 그 종류를 확인할  수 있다.

 

https://reactnative.dev/docs/components-and-apis

 

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

 

스타일링

네이티브에서 스타일링은 기본적으로 자바스크립트를 통해 입히고 그 방법은 CSS Module과 흡사하다.

(module은 css 파일을 따로 만들지만 여기선 styled-component처럼 같은 파일 안에 정의)

 

그리고 그 정의 방법은 인라인 스타일링을 객체 형태로 집어넣을 때처럼 카멜케이스를 이용한다.

(ex. margin-left  〉  marginLeft)

 

 

InputForm

 

Button