SlideShare une entreprise Scribd logo
1  sur  36
Télécharger pour lire hors ligne
React Native를 사용한

초간단 커뮤니티 앱 제작
김태곤 | http://taegon.kim
Who am I?
@taggon
http://taegon.kim
NHN NEXT
이런 앱을 만들겁니다.
오늘 발표에서는
http://youtu.be/fRaC9jECxCg 참고
30분만에 만듭니다.
이런 앱을
< 발표자
20:05 0
대박!! 누구나 30분만에

앱을 만들 수 있다는 건가요?
2015년 5월 6일 수요일
20:06
... 그럴리가요? 저도
다 외워서 하는 겁니다.
20:06
개발환경
우선
을 구성합니다.
개발환경
1. Xcode는 당연히 필수입니다.
2. node, watchman, flow를 설치합니다.







3. React Native 클라이언트 도구를 설치합니다.

4. 프로젝트를 생성합니다.
brew install node 필수. iojs로 대체 가능
brew install watchman 권장. 파일 변경 감시
brew install flow 선택. 정적 타입 체커
npm install -g react-native-cli
react-native init TidevProject
개발환경
프로젝트 폴더 및 파일 구성
TidevProject/
TidevProject.xcodeproj

TidevProjectTests/

iOS/
main.jsbundle
AppDelegate.h
AppDelegate.m
...
node_modules/
react-native/
...

index.ios.js

package.json
프로젝트 파일
iOS용 주요 파일
앱 JS 파일 번들
nodeJS 모듈
앱 시작 JS 파일
개발환경
5. react-native-icons, underscore 패키지를 설치합니다.

6. 패키지 서버를 실행합니다.

7. 작성된 패키지 파일은 웹을 통해 접근할 수 있습니다.
npm install react-native-icons underscore --save
npm start
open "http://localhost:8081/index.ios.bundle"
React Native의 특징
본격 코딩에 앞서
을 살펴봅시다.
React Native의 특징
1. React와 같은 방식으로 컴포넌트를 만듭니다.











2. React 컴포넌트 특수 메소드와 속성도 그대로 동작합니다.

https://facebook.github.io/react/docs/component-specs.html 참고
3. NodeJS처럼 require를 통해 다른 모듈을 참조합니다.
var ComponentName = React.createClass({
render: function() {
return (
<View>
<Text>Hello, {name}</Text>
</View>
);
}
});
미리 정의된 네이티브 컴포넌트 사용
var React = require('react-native');
4. 일부 ES6, ES7 기능을 사용할 수 있습니다. (계속)
// Destructuring Assignment

var React = require('react-native');
var { View, Text } = React;
// var View = React.View, Text = React.Text; 와 같다.
// 클래스
class Component extends React.Component {
render() {

return <View />;

}
}
// 간편 메소드 선언

var Component = React.createClass({

render() {

return <View />;

}

});
컴포넌트 공통 처리를
직접 해야 해서 권장하지 않음
React Native의 특징
4. 일부 ES6, ES7 기능을 사용할 수 있습니다. (계속)
// Arrow function : 더 간결한 코드 + this 유지

/* (a, b) => this.method(a, b)

(function(a, b){ return this.method(a, b); }).bind(this)
arg => { this.method(arg) }
(function(arg){ this.method(arg); }).bind(this)

*/

var Component = React.createClass({
onSelect(event, switch) {
...
},
render() {
return <View onPress={(e) => this.onSelect(e,true)} />;
}
});
// 템플릿 문자열 (멀티라인도 가능)
var who = 'world';
var str = `Hello ${who}`;
React Native의 특징
4. 일부 ES6, ES7 기능을 사용할 수 있습니다.













https://facebook.github.io/react-native/docs/javascript-environment.html 참고
5. AppRegistry를 통해 시작 컴포넌트를 설정해야 합니다.
// Promise 객체

Promise.resolve(3)
.then(data => {
...
})
.catch(reason => {
console.log(reason);
});
var {AppRegistry} = require('react-native');
...
AppRegistry.registerComponent('Tidev', () => App);
React Native의 특징
6. 스타일은 객체처럼 만들고 프로퍼티로 전달합니다.























https://facebook.github.io/react-native/docs/style.html 참고
var styles = StylesSheet.create({
titleContainer: {
flex: 1,
flexDirection: 'row'
},
title: {
fontSize: 16,
color: 'white'
}

});
...
<View style={styles.titleContainer}>

<Text style={styles.title}>Hello</Text>

<Text>World</Text>

</View>
React Native의 특징
7. XMLHttpRequest, Fetch API를 통해 통신합니다.













https://facebook.github.io/react-native/docs/network.html 참고
fetch('https://site.com/path', options)
.then( response => response.text() )
.then( responseText => {
console.log(responseText);
})
.catch( error => {
console.warn(error);
});
React Native의 특징
Flexbox
레이아웃을 정하는
에 대해 알아봅시다.
Flexbox
1. 부모 컨테이너와 자식 노드의 관계로 정의합니다.
2. 자식 노드를 배치하는 방법은 컨테이너가 정합니다.
3. 자식 노드가 차지하는 영역의 크기는 자식 노드가 정합니다.
.container {
flex-direction: row;
}
.children {
flex: 1;
}
<div class="container">
<div class="children"></div>
<div class="children"></div>
<div class="children"></div>
</div>
축(axis)을 설정.

따라서 자식은 가로로 배열됨
형제 Flexbox와의 비율 +
영역에 맞춰 늘거나 줄도록 설정
Flexbox
1. 부모 컨테이너와 자식 노드의 관계로 정의합니다.
2. 자식 노드를 배치하는 방법은 컨테이너가 정합니다.
3. 자식 노드가 차지하는 영역의 크기는 자식 노드가 정합니다.
1 11
Flexbox
1 11
.container {
flex-direction: row;
}
.children {
flex: 1;
}
Flexbox
1 12
.container {
flex-direction: row;
}
.children {
flex: 1;
}
.children:first-child {
flex: 2;
} 첫 번째 자식 노드는

2의 비율을 차지함.
Flexbox
1 1100px
.container {
flex-direction: row;
}
.children {
flex: 1;
}
.children:first-child {
width: 100px;
}
첫 번째 자식 노드가 100px 고정폭으로

표현되고 나머지 영역을 Flexible box가
비율대로 나누어 가짐.
Flexbox
1 1100px
.container {
flex-direction: row;
align-items: flex-start;
}
.children {
flex: 1;
}
.children:first-child {
width: 100px;
}
Flexbox
1 1100px
.container {
flex-direction: row;
align-items: flex-start;
}
.children {
flex: 1;
}
.children:first-child {
width: 100px;
}
flex-end;
Flexbox
1 1100px
.container {
flex-direction: row;
align-items: flex-start;
}
.children {
flex: 1;
}
.children:first-child {
width: 100px;
}
center;
Flexbox
1 1100px
.container {
flex-direction: row;
align-items: flex-start;
}
.children {
flex: 1;
}
.children:first-child {
width: 100px;
}
stretch;
Flexbox
1
1
100px.container {
flex-direction: row;
align-items: flex-start;
}
.children {
flex: 1;
}
.children:first-child {
width: 100px;
}
stretch;
column;
height: 100px;
Flexbox
• A Complete guide to Flexbox

https://css-tricks.com/snippets/css/a-guide-to-flexbox/
• Flexbox Playground

https://scotch.io/demos/visual-guide-to-css3-flexbox-flexbox-playground
• React Native: Flexbox

https://facebook.github.io/react-native/docs/flexbox.html
• W3C: CSS Flexible Box Layout Module Level 1

http://www.w3.org/TR/css-flexbox-1/
코딩
이제부터
을 시작합니다.
코딩
TidevProject/
TidevProject.xcodeproj

TidevProjectTests/

iOS/

node_modules/
index.ios.js

package.json
프로젝트 폴더 및 파일 구성
App/
App.js

TopicList.js
TopicListItem.js
TopicView.js
TopicMixin.js
contentTemplate.js
코딩
프로젝트 폴더 및 파일 구성
App/
App.js

TopicList.js
TopicListItem.js
TopicView.js
TopicMixin.js
contentTemplate.js
코딩
프로젝트 폴더 및 파일 구성
App/
App.js

TopicList.js
TopicListItem.js
TopicView.js
TopicMixin.js
contentTemplate.js
<WebView />
회고를 해보자면...
개발 과정에 대해
회고
1. React를 알면 빠르게 만들 수 있다.

= 모르면 학습 시간이 필요하다.
2. Flexbox 레이아웃과 CSS 비슷한 스타일링은 편하다.
3. 아직 다소 불안정하다.

- 여전히 수정해야 할 버그가 많다.

- 다행히 상당히 빠르게 패치가 되고 있다.

- 크롬 디버거 연결에 안정성 좀... ㅠ_ㅠ
4. 네이티브를 아예 모르면 힘들다.

- 확장 기능을 사용하려해도 알아야 한다.

- Objective-C에 대한 눈치 정도라도 있어야 한다.

- 많이는 몰라도 된다.
오픈 소스로 공개되어 있습니다.
오늘 코드는
http://github.com/taggon/tidev
감사합니다.

Contenu connexe

Tendances

Apache kafka performance(latency)_benchmark_v0.3
Apache kafka performance(latency)_benchmark_v0.3Apache kafka performance(latency)_benchmark_v0.3
Apache kafka performance(latency)_benchmark_v0.3SANG WON PARK
 
Near Real-Time Analytics with Apache Spark: Ingestion, ETL, and Interactive Q...
Near Real-Time Analytics with Apache Spark: Ingestion, ETL, and Interactive Q...Near Real-Time Analytics with Apache Spark: Ingestion, ETL, and Interactive Q...
Near Real-Time Analytics with Apache Spark: Ingestion, ETL, and Interactive Q...Databricks
 
제 17회 보아즈(BOAZ) 빅데이터 컨퍼런스 - [Catch, Traffic!] : 지하철 혼잡도 및 키워드 분석 데이터 파이프라인 구축
제 17회 보아즈(BOAZ) 빅데이터 컨퍼런스 - [Catch, Traffic!] : 지하철 혼잡도 및 키워드 분석 데이터 파이프라인 구축제 17회 보아즈(BOAZ) 빅데이터 컨퍼런스 - [Catch, Traffic!] : 지하철 혼잡도 및 키워드 분석 데이터 파이프라인 구축
제 17회 보아즈(BOAZ) 빅데이터 컨퍼런스 - [Catch, Traffic!] : 지하철 혼잡도 및 키워드 분석 데이터 파이프라인 구축BOAZ Bigdata
 
[261] 실시간 추천엔진 머신한대에 구겨넣기
[261] 실시간 추천엔진 머신한대에 구겨넣기[261] 실시간 추천엔진 머신한대에 구겨넣기
[261] 실시간 추천엔진 머신한대에 구겨넣기NAVER D2
 
Rule based approach to sentiment analysis at romip’11 slides
Rule based approach to sentiment analysis at romip’11 slidesRule based approach to sentiment analysis at romip’11 slides
Rule based approach to sentiment analysis at romip’11 slidesDmitry Kan
 
BigQuery의 모든 것(기획자, 마케터, 신입 데이터 분석가를 위한) 입문편
BigQuery의 모든 것(기획자, 마케터, 신입 데이터 분석가를 위한) 입문편BigQuery의 모든 것(기획자, 마케터, 신입 데이터 분석가를 위한) 입문편
BigQuery의 모든 것(기획자, 마케터, 신입 데이터 분석가를 위한) 입문편Seongyun Byeon
 
컴포넌트 관점에서 개발하기
컴포넌트 관점에서 개발하기컴포넌트 관점에서 개발하기
컴포넌트 관점에서 개발하기우영 주
 
Kubernetes Forum Seoul 2019: Re-architecting Data Platform with Kubernetes
Kubernetes Forum Seoul 2019: Re-architecting Data Platform with KubernetesKubernetes Forum Seoul 2019: Re-architecting Data Platform with Kubernetes
Kubernetes Forum Seoul 2019: Re-architecting Data Platform with KubernetesSeungYong Oh
 
서버 성능에 대한 정의와 이해
서버 성능에 대한 정의와 이해서버 성능에 대한 정의와 이해
서버 성능에 대한 정의와 이해중선 곽
 
"Quantizing Deep Networks for Efficient Inference at the Edge," a Presentatio...
"Quantizing Deep Networks for Efficient Inference at the Edge," a Presentatio..."Quantizing Deep Networks for Efficient Inference at the Edge," a Presentatio...
"Quantizing Deep Networks for Efficient Inference at the Edge," a Presentatio...Edge AI and Vision Alliance
 
[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기
[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기
[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기NAVER D2
 
Quic을 이용한 네트워크 성능 개선
 Quic을 이용한 네트워크 성능 개선 Quic을 이용한 네트워크 성능 개선
Quic을 이용한 네트워크 성능 개선NAVER D2
 
예외처리가이드
예외처리가이드예외처리가이드
예외처리가이드도형 임
 
파이썬 생존 안내서 (자막)
파이썬 생존 안내서 (자막)파이썬 생존 안내서 (자막)
파이썬 생존 안내서 (자막)Heungsub Lee
 
Sherlock: an anomaly detection service on top of Druid
Sherlock: an anomaly detection service on top of Druid Sherlock: an anomaly detection service on top of Druid
Sherlock: an anomaly detection service on top of Druid DataWorks Summit
 
김민욱, (달빛조각사) 엘릭서를 이용한 mmorpg 서버 개발, NDC2019
김민욱, (달빛조각사) 엘릭서를 이용한 mmorpg 서버 개발, NDC2019김민욱, (달빛조각사) 엘릭서를 이용한 mmorpg 서버 개발, NDC2019
김민욱, (달빛조각사) 엘릭서를 이용한 mmorpg 서버 개발, NDC2019min woog kim
 
Flexible and Real-Time Stream Processing with Apache Flink
Flexible and Real-Time Stream Processing with Apache FlinkFlexible and Real-Time Stream Processing with Apache Flink
Flexible and Real-Time Stream Processing with Apache FlinkDataWorks Summit
 
Apache Pulsar Development 101 with Python
Apache Pulsar Development 101 with PythonApache Pulsar Development 101 with Python
Apache Pulsar Development 101 with PythonTimothy Spann
 
Boltdb - an embedded key value database
Boltdb - an embedded key value databaseBoltdb - an embedded key value database
Boltdb - an embedded key value databaseManoj Awasthi
 

Tendances (20)

Apache kafka performance(latency)_benchmark_v0.3
Apache kafka performance(latency)_benchmark_v0.3Apache kafka performance(latency)_benchmark_v0.3
Apache kafka performance(latency)_benchmark_v0.3
 
Near Real-Time Analytics with Apache Spark: Ingestion, ETL, and Interactive Q...
Near Real-Time Analytics with Apache Spark: Ingestion, ETL, and Interactive Q...Near Real-Time Analytics with Apache Spark: Ingestion, ETL, and Interactive Q...
Near Real-Time Analytics with Apache Spark: Ingestion, ETL, and Interactive Q...
 
제 17회 보아즈(BOAZ) 빅데이터 컨퍼런스 - [Catch, Traffic!] : 지하철 혼잡도 및 키워드 분석 데이터 파이프라인 구축
제 17회 보아즈(BOAZ) 빅데이터 컨퍼런스 - [Catch, Traffic!] : 지하철 혼잡도 및 키워드 분석 데이터 파이프라인 구축제 17회 보아즈(BOAZ) 빅데이터 컨퍼런스 - [Catch, Traffic!] : 지하철 혼잡도 및 키워드 분석 데이터 파이프라인 구축
제 17회 보아즈(BOAZ) 빅데이터 컨퍼런스 - [Catch, Traffic!] : 지하철 혼잡도 및 키워드 분석 데이터 파이프라인 구축
 
[261] 실시간 추천엔진 머신한대에 구겨넣기
[261] 실시간 추천엔진 머신한대에 구겨넣기[261] 실시간 추천엔진 머신한대에 구겨넣기
[261] 실시간 추천엔진 머신한대에 구겨넣기
 
Rule based approach to sentiment analysis at romip’11 slides
Rule based approach to sentiment analysis at romip’11 slidesRule based approach to sentiment analysis at romip’11 slides
Rule based approach to sentiment analysis at romip’11 slides
 
BigQuery의 모든 것(기획자, 마케터, 신입 데이터 분석가를 위한) 입문편
BigQuery의 모든 것(기획자, 마케터, 신입 데이터 분석가를 위한) 입문편BigQuery의 모든 것(기획자, 마케터, 신입 데이터 분석가를 위한) 입문편
BigQuery의 모든 것(기획자, 마케터, 신입 데이터 분석가를 위한) 입문편
 
컴포넌트 관점에서 개발하기
컴포넌트 관점에서 개발하기컴포넌트 관점에서 개발하기
컴포넌트 관점에서 개발하기
 
Kubernetes Forum Seoul 2019: Re-architecting Data Platform with Kubernetes
Kubernetes Forum Seoul 2019: Re-architecting Data Platform with KubernetesKubernetes Forum Seoul 2019: Re-architecting Data Platform with Kubernetes
Kubernetes Forum Seoul 2019: Re-architecting Data Platform with Kubernetes
 
서버 성능에 대한 정의와 이해
서버 성능에 대한 정의와 이해서버 성능에 대한 정의와 이해
서버 성능에 대한 정의와 이해
 
"Quantizing Deep Networks for Efficient Inference at the Edge," a Presentatio...
"Quantizing Deep Networks for Efficient Inference at the Edge," a Presentatio..."Quantizing Deep Networks for Efficient Inference at the Edge," a Presentatio...
"Quantizing Deep Networks for Efficient Inference at the Edge," a Presentatio...
 
[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기
[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기
[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기
 
Flink Streaming
Flink StreamingFlink Streaming
Flink Streaming
 
Quic을 이용한 네트워크 성능 개선
 Quic을 이용한 네트워크 성능 개선 Quic을 이용한 네트워크 성능 개선
Quic을 이용한 네트워크 성능 개선
 
예외처리가이드
예외처리가이드예외처리가이드
예외처리가이드
 
파이썬 생존 안내서 (자막)
파이썬 생존 안내서 (자막)파이썬 생존 안내서 (자막)
파이썬 생존 안내서 (자막)
 
Sherlock: an anomaly detection service on top of Druid
Sherlock: an anomaly detection service on top of Druid Sherlock: an anomaly detection service on top of Druid
Sherlock: an anomaly detection service on top of Druid
 
김민욱, (달빛조각사) 엘릭서를 이용한 mmorpg 서버 개발, NDC2019
김민욱, (달빛조각사) 엘릭서를 이용한 mmorpg 서버 개발, NDC2019김민욱, (달빛조각사) 엘릭서를 이용한 mmorpg 서버 개발, NDC2019
김민욱, (달빛조각사) 엘릭서를 이용한 mmorpg 서버 개발, NDC2019
 
Flexible and Real-Time Stream Processing with Apache Flink
Flexible and Real-Time Stream Processing with Apache FlinkFlexible and Real-Time Stream Processing with Apache Flink
Flexible and Real-Time Stream Processing with Apache Flink
 
Apache Pulsar Development 101 with Python
Apache Pulsar Development 101 with PythonApache Pulsar Development 101 with Python
Apache Pulsar Development 101 with Python
 
Boltdb - an embedded key value database
Boltdb - an embedded key value databaseBoltdb - an embedded key value database
Boltdb - an embedded key value database
 

Similaire à React Native를 사용한
 초간단 커뮤니티 앱 제작

React 실무활용 이야기
React 실무활용 이야기React 실무활용 이야기
React 실무활용 이야기철민 배
 
[React-Native-Seoul] React-Native 초심자를 위한 실습위주의 간단한 소개 및 구현법 안내
[React-Native-Seoul] React-Native 초심자를 위한 실습위주의 간단한 소개 및 구현법 안내[React-Native-Seoul] React-Native 초심자를 위한 실습위주의 간단한 소개 및 구현법 안내
[React-Native-Seoul] React-Native 초심자를 위한 실습위주의 간단한 소개 및 구현법 안내Tae-Seong Park
 
React Hooks 마법. 그리고 깔끔한 사용기
React Hooks 마법. 그리고 깔끔한 사용기React Hooks 마법. 그리고 깔끔한 사용기
React Hooks 마법. 그리고 깔끔한 사용기NAVER SHOPPING
 
[자마린교육/자마린실습]자바,스프링프레임워크(스프링부트) RESTful 웹서비스 구현 실습,자마린에서 스프링 웹서비스를 호출하고 응답 JS...
[자마린교육/자마린실습]자바,스프링프레임워크(스프링부트) RESTful 웹서비스 구현 실습,자마린에서 스프링 웹서비스를 호출하고 응답 JS...[자마린교육/자마린실습]자바,스프링프레임워크(스프링부트) RESTful 웹서비스 구현 실습,자마린에서 스프링 웹서비스를 호출하고 응답 JS...
[자마린교육/자마린실습]자바,스프링프레임워크(스프링부트) RESTful 웹서비스 구현 실습,자마린에서 스프링 웹서비스를 호출하고 응답 JS...탑크리에듀(구로디지털단지역3번출구 2분거리)
 
Meteor React Tutorial 따라하기
Meteor React Tutorial 따라하기Meteor React Tutorial 따라하기
Meteor React Tutorial 따라하기Jiam Seo
 
Introduction to Fork Join Framework_SYS4U I&C
Introduction to Fork Join Framework_SYS4U I&CIntroduction to Fork Join Framework_SYS4U I&C
Introduction to Fork Join Framework_SYS4U I&Csys4u
 
Javascript 교육자료 pdf
Javascript 교육자료 pdfJavascript 교육자료 pdf
Javascript 교육자료 pdfHyosang Hong
 
Javascript 실행 가능한 코드(Executable Code)와 실행 콘텍스트(Execution Context), Lexical En...
Javascript 실행 가능한 코드(Executable Code)와 실행 콘텍스트(Execution Context), Lexical En...Javascript 실행 가능한 코드(Executable Code)와 실행 콘텍스트(Execution Context), Lexical En...
Javascript 실행 가능한 코드(Executable Code)와 실행 콘텍스트(Execution Context), Lexical En...Young-Beom Rhee
 
React native 개발 및 javascript 기본
React native 개발 및 javascript 기본React native 개발 및 javascript 기본
React native 개발 및 javascript 기본Tj .
 
Klaytn Developer Meetup_20191022
Klaytn Developer Meetup_20191022Klaytn Developer Meetup_20191022
Klaytn Developer Meetup_20191022Klaytn
 
Spring Boot + React + Gradle in VSCode
Spring Boot + React + Gradle in VSCodeSpring Boot + React + Gradle in VSCode
Spring Boot + React + Gradle in VSCodedpTablo
 
React 애플리케이션 아키텍처 - 아무도 알려주지 않아서 혼자서 삽질했다.
React 애플리케이션 아키텍처 - 아무도 알려주지 않아서 혼자서 삽질했다.React 애플리케이션 아키텍처 - 아무도 알려주지 않아서 혼자서 삽질했다.
React 애플리케이션 아키텍처 - 아무도 알려주지 않아서 혼자서 삽질했다.병대 손
 
Node.js and react
Node.js and reactNode.js and react
Node.js and reactHyungKuIm
 
[JS] Function.prototype.bind
[JS] Function.prototype.bind[JS] Function.prototype.bind
[JS] Function.prototype.bindJinhyuck Kim
 

Similaire à React Native를 사용한
 초간단 커뮤니티 앱 제작 (20)

React 실무활용 이야기
React 실무활용 이야기React 실무활용 이야기
React 실무활용 이야기
 
[React-Native-Seoul] React-Native 초심자를 위한 실습위주의 간단한 소개 및 구현법 안내
[React-Native-Seoul] React-Native 초심자를 위한 실습위주의 간단한 소개 및 구현법 안내[React-Native-Seoul] React-Native 초심자를 위한 실습위주의 간단한 소개 및 구현법 안내
[React-Native-Seoul] React-Native 초심자를 위한 실습위주의 간단한 소개 및 구현법 안내
 
[Codelab 2017] ReactJS 기초
[Codelab 2017] ReactJS 기초[Codelab 2017] ReactJS 기초
[Codelab 2017] ReactJS 기초
 
react-ko.pdf
react-ko.pdfreact-ko.pdf
react-ko.pdf
 
(스프링프레임워크 강좌)스프링부트개요 및 HelloWorld 따라하기
(스프링프레임워크 강좌)스프링부트개요 및 HelloWorld 따라하기(스프링프레임워크 강좌)스프링부트개요 및 HelloWorld 따라하기
(스프링프레임워크 강좌)스프링부트개요 및 HelloWorld 따라하기
 
React Hooks 마법. 그리고 깔끔한 사용기
React Hooks 마법. 그리고 깔끔한 사용기React Hooks 마법. 그리고 깔끔한 사용기
React Hooks 마법. 그리고 깔끔한 사용기
 
Modern android
Modern androidModern android
Modern android
 
[자마린교육/자마린실습]자바,스프링프레임워크(스프링부트) RESTful 웹서비스 구현 실습,자마린에서 스프링 웹서비스를 호출하고 응답 JS...
[자마린교육/자마린실습]자바,스프링프레임워크(스프링부트) RESTful 웹서비스 구현 실습,자마린에서 스프링 웹서비스를 호출하고 응답 JS...[자마린교육/자마린실습]자바,스프링프레임워크(스프링부트) RESTful 웹서비스 구현 실습,자마린에서 스프링 웹서비스를 호출하고 응답 JS...
[자마린교육/자마린실습]자바,스프링프레임워크(스프링부트) RESTful 웹서비스 구현 실습,자마린에서 스프링 웹서비스를 호출하고 응답 JS...
 
Meteor React Tutorial 따라하기
Meteor React Tutorial 따라하기Meteor React Tutorial 따라하기
Meteor React Tutorial 따라하기
 
Introduction to Fork Join Framework_SYS4U I&C
Introduction to Fork Join Framework_SYS4U I&CIntroduction to Fork Join Framework_SYS4U I&C
Introduction to Fork Join Framework_SYS4U I&C
 
Javascript 교육자료 pdf
Javascript 교육자료 pdfJavascript 교육자료 pdf
Javascript 교육자료 pdf
 
Javascript 실행 가능한 코드(Executable Code)와 실행 콘텍스트(Execution Context), Lexical En...
Javascript 실행 가능한 코드(Executable Code)와 실행 콘텍스트(Execution Context), Lexical En...Javascript 실행 가능한 코드(Executable Code)와 실행 콘텍스트(Execution Context), Lexical En...
Javascript 실행 가능한 코드(Executable Code)와 실행 콘텍스트(Execution Context), Lexical En...
 
React native 개발 및 javascript 기본
React native 개발 및 javascript 기본React native 개발 및 javascript 기본
React native 개발 및 javascript 기본
 
Spring boot DI
Spring boot DISpring boot DI
Spring boot DI
 
Klaytn Developer Meetup_20191022
Klaytn Developer Meetup_20191022Klaytn Developer Meetup_20191022
Klaytn Developer Meetup_20191022
 
Spring Boot + React + Gradle in VSCode
Spring Boot + React + Gradle in VSCodeSpring Boot + React + Gradle in VSCode
Spring Boot + React + Gradle in VSCode
 
React 애플리케이션 아키텍처 - 아무도 알려주지 않아서 혼자서 삽질했다.
React 애플리케이션 아키텍처 - 아무도 알려주지 않아서 혼자서 삽질했다.React 애플리케이션 아키텍처 - 아무도 알려주지 않아서 혼자서 삽질했다.
React 애플리케이션 아키텍처 - 아무도 알려주지 않아서 혼자서 삽질했다.
 
Eclipse RCP 1/2
Eclipse RCP 1/2Eclipse RCP 1/2
Eclipse RCP 1/2
 
Node.js and react
Node.js and reactNode.js and react
Node.js and react
 
[JS] Function.prototype.bind
[JS] Function.prototype.bind[JS] Function.prototype.bind
[JS] Function.prototype.bind
 

Plus de Taegon Kim

FE로 취업 전에 알았으면 좋았을 것들
FE로 취업 전에 알았으면 좋았을 것들FE로 취업 전에 알았으면 좋았을 것들
FE로 취업 전에 알았으면 좋았을 것들Taegon Kim
 
프론트엔드 코딩 컨벤션 자동화 도구
프론트엔드 코딩 컨벤션 자동화 도구프론트엔드 코딩 컨벤션 자동화 도구
프론트엔드 코딩 컨벤션 자동화 도구Taegon Kim
 
Universal Rendering
Universal RenderingUniversal Rendering
Universal RenderingTaegon Kim
 
ReactJS로 시작하는 멀티플랫폼 개발하기
ReactJS로 시작하는 멀티플랫폼 개발하기ReactJS로 시작하는 멀티플랫폼 개발하기
ReactJS로 시작하는 멀티플랫폼 개발하기Taegon Kim
 
ReactJS | 서버와 클라이어트에서 동시에 사용하는
ReactJS | 서버와 클라이어트에서 동시에 사용하는ReactJS | 서버와 클라이어트에서 동시에 사용하는
ReactJS | 서버와 클라이어트에서 동시에 사용하는Taegon Kim
 
패스트캠퍼스 프론트엔드 강의 오리엔테이션
패스트캠퍼스 프론트엔드 강의 오리엔테이션패스트캠퍼스 프론트엔드 강의 오리엔테이션
패스트캠퍼스 프론트엔드 강의 오리엔테이션Taegon Kim
 
오늘 당장 시작하는 HTML5
오늘 당장 시작하는 HTML5오늘 당장 시작하는 HTML5
오늘 당장 시작하는 HTML5Taegon Kim
 
Fiddler: 웹 디버깅 프록시
Fiddler: 웹 디버깅 프록시Fiddler: 웹 디버깅 프록시
Fiddler: 웹 디버깅 프록시Taegon Kim
 
진화하는 소셜 큐레이션 서비스와 관련 기술
진화하는 소셜 큐레이션 서비스와 관련 기술진화하는 소셜 큐레이션 서비스와 관련 기술
진화하는 소셜 큐레이션 서비스와 관련 기술Taegon Kim
 
XpressEngine : 보드에서 CMS로
XpressEngine : 보드에서 CMS로XpressEngine : 보드에서 CMS로
XpressEngine : 보드에서 CMS로Taegon Kim
 

Plus de Taegon Kim (11)

FE로 취업 전에 알았으면 좋았을 것들
FE로 취업 전에 알았으면 좋았을 것들FE로 취업 전에 알았으면 좋았을 것들
FE로 취업 전에 알았으면 좋았을 것들
 
프론트엔드 코딩 컨벤션 자동화 도구
프론트엔드 코딩 컨벤션 자동화 도구프론트엔드 코딩 컨벤션 자동화 도구
프론트엔드 코딩 컨벤션 자동화 도구
 
Universal Rendering
Universal RenderingUniversal Rendering
Universal Rendering
 
ReactJS로 시작하는 멀티플랫폼 개발하기
ReactJS로 시작하는 멀티플랫폼 개발하기ReactJS로 시작하는 멀티플랫폼 개발하기
ReactJS로 시작하는 멀티플랫폼 개발하기
 
ReactJS | 서버와 클라이어트에서 동시에 사용하는
ReactJS | 서버와 클라이어트에서 동시에 사용하는ReactJS | 서버와 클라이어트에서 동시에 사용하는
ReactJS | 서버와 클라이어트에서 동시에 사용하는
 
패스트캠퍼스 프론트엔드 강의 오리엔테이션
패스트캠퍼스 프론트엔드 강의 오리엔테이션패스트캠퍼스 프론트엔드 강의 오리엔테이션
패스트캠퍼스 프론트엔드 강의 오리엔테이션
 
오늘 당장 시작하는 HTML5
오늘 당장 시작하는 HTML5오늘 당장 시작하는 HTML5
오늘 당장 시작하는 HTML5
 
Fiddler: 웹 디버깅 프록시
Fiddler: 웹 디버깅 프록시Fiddler: 웹 디버깅 프록시
Fiddler: 웹 디버깅 프록시
 
진화하는 소셜 큐레이션 서비스와 관련 기술
진화하는 소셜 큐레이션 서비스와 관련 기술진화하는 소셜 큐레이션 서비스와 관련 기술
진화하는 소셜 큐레이션 서비스와 관련 기술
 
XpressEngine : 보드에서 CMS로
XpressEngine : 보드에서 CMS로XpressEngine : 보드에서 CMS로
XpressEngine : 보드에서 CMS로
 
jQuery Trend
jQuery TrendjQuery Trend
jQuery Trend
 

React Native를 사용한
 초간단 커뮤니티 앱 제작

  • 1. React Native를 사용한
 초간단 커뮤니티 앱 제작 김태곤 | http://taegon.kim
  • 3. 이런 앱을 만들겁니다. 오늘 발표에서는 http://youtu.be/fRaC9jECxCg 참고
  • 5. < 발표자 20:05 0 대박!! 누구나 30분만에
 앱을 만들 수 있다는 건가요? 2015년 5월 6일 수요일 20:06 ... 그럴리가요? 저도 다 외워서 하는 겁니다. 20:06
  • 7. 개발환경 1. Xcode는 당연히 필수입니다. 2. node, watchman, flow를 설치합니다.
 
 
 
 3. React Native 클라이언트 도구를 설치합니다.
 4. 프로젝트를 생성합니다. brew install node 필수. iojs로 대체 가능 brew install watchman 권장. 파일 변경 감시 brew install flow 선택. 정적 타입 체커 npm install -g react-native-cli react-native init TidevProject
  • 8. 개발환경 프로젝트 폴더 및 파일 구성 TidevProject/ TidevProject.xcodeproj
 TidevProjectTests/
 iOS/ main.jsbundle AppDelegate.h AppDelegate.m ... node_modules/ react-native/ ...
 index.ios.js
 package.json 프로젝트 파일 iOS용 주요 파일 앱 JS 파일 번들 nodeJS 모듈 앱 시작 JS 파일
  • 9. 개발환경 5. react-native-icons, underscore 패키지를 설치합니다.
 6. 패키지 서버를 실행합니다.
 7. 작성된 패키지 파일은 웹을 통해 접근할 수 있습니다. npm install react-native-icons underscore --save npm start open "http://localhost:8081/index.ios.bundle"
  • 10. React Native의 특징 본격 코딩에 앞서 을 살펴봅시다.
  • 11. React Native의 특징 1. React와 같은 방식으로 컴포넌트를 만듭니다.
 
 
 
 
 
 2. React 컴포넌트 특수 메소드와 속성도 그대로 동작합니다.
 https://facebook.github.io/react/docs/component-specs.html 참고 3. NodeJS처럼 require를 통해 다른 모듈을 참조합니다. var ComponentName = React.createClass({ render: function() { return ( <View> <Text>Hello, {name}</Text> </View> ); } }); 미리 정의된 네이티브 컴포넌트 사용 var React = require('react-native');
  • 12. 4. 일부 ES6, ES7 기능을 사용할 수 있습니다. (계속) // Destructuring Assignment
 var React = require('react-native'); var { View, Text } = React; // var View = React.View, Text = React.Text; 와 같다. // 클래스 class Component extends React.Component { render() {
 return <View />;
 } } // 간편 메소드 선언
 var Component = React.createClass({
 render() {
 return <View />;
 }
 }); 컴포넌트 공통 처리를 직접 해야 해서 권장하지 않음 React Native의 특징
  • 13. 4. 일부 ES6, ES7 기능을 사용할 수 있습니다. (계속) // Arrow function : 더 간결한 코드 + this 유지
 /* (a, b) => this.method(a, b)
 (function(a, b){ return this.method(a, b); }).bind(this) arg => { this.method(arg) } (function(arg){ this.method(arg); }).bind(this)
 */
 var Component = React.createClass({ onSelect(event, switch) { ... }, render() { return <View onPress={(e) => this.onSelect(e,true)} />; } }); // 템플릿 문자열 (멀티라인도 가능) var who = 'world'; var str = `Hello ${who}`; React Native의 특징
  • 14. 4. 일부 ES6, ES7 기능을 사용할 수 있습니다.
 
 
 
 
 
 
 https://facebook.github.io/react-native/docs/javascript-environment.html 참고 5. AppRegistry를 통해 시작 컴포넌트를 설정해야 합니다. // Promise 객체
 Promise.resolve(3) .then(data => { ... }) .catch(reason => { console.log(reason); }); var {AppRegistry} = require('react-native'); ... AppRegistry.registerComponent('Tidev', () => App); React Native의 특징
  • 15. 6. 스타일은 객체처럼 만들고 프로퍼티로 전달합니다.
 
 
 
 
 
 
 
 
 
 
 
 https://facebook.github.io/react-native/docs/style.html 참고 var styles = StylesSheet.create({ titleContainer: { flex: 1, flexDirection: 'row' }, title: { fontSize: 16, color: 'white' }
 }); ... <View style={styles.titleContainer}>
 <Text style={styles.title}>Hello</Text>
 <Text>World</Text>
 </View> React Native의 특징
  • 16. 7. XMLHttpRequest, Fetch API를 통해 통신합니다.
 
 
 
 
 
 
 https://facebook.github.io/react-native/docs/network.html 참고 fetch('https://site.com/path', options) .then( response => response.text() ) .then( responseText => { console.log(responseText); }) .catch( error => { console.warn(error); }); React Native의 특징
  • 18. Flexbox 1. 부모 컨테이너와 자식 노드의 관계로 정의합니다. 2. 자식 노드를 배치하는 방법은 컨테이너가 정합니다. 3. 자식 노드가 차지하는 영역의 크기는 자식 노드가 정합니다. .container { flex-direction: row; } .children { flex: 1; } <div class="container"> <div class="children"></div> <div class="children"></div> <div class="children"></div> </div> 축(axis)을 설정.
 따라서 자식은 가로로 배열됨 형제 Flexbox와의 비율 + 영역에 맞춰 늘거나 줄도록 설정
  • 19. Flexbox 1. 부모 컨테이너와 자식 노드의 관계로 정의합니다. 2. 자식 노드를 배치하는 방법은 컨테이너가 정합니다. 3. 자식 노드가 차지하는 영역의 크기는 자식 노드가 정합니다. 1 11
  • 20. Flexbox 1 11 .container { flex-direction: row; } .children { flex: 1; }
  • 21. Flexbox 1 12 .container { flex-direction: row; } .children { flex: 1; } .children:first-child { flex: 2; } 첫 번째 자식 노드는
 2의 비율을 차지함.
  • 22. Flexbox 1 1100px .container { flex-direction: row; } .children { flex: 1; } .children:first-child { width: 100px; } 첫 번째 자식 노드가 100px 고정폭으로
 표현되고 나머지 영역을 Flexible box가 비율대로 나누어 가짐.
  • 23. Flexbox 1 1100px .container { flex-direction: row; align-items: flex-start; } .children { flex: 1; } .children:first-child { width: 100px; }
  • 24. Flexbox 1 1100px .container { flex-direction: row; align-items: flex-start; } .children { flex: 1; } .children:first-child { width: 100px; } flex-end;
  • 25. Flexbox 1 1100px .container { flex-direction: row; align-items: flex-start; } .children { flex: 1; } .children:first-child { width: 100px; } center;
  • 26. Flexbox 1 1100px .container { flex-direction: row; align-items: flex-start; } .children { flex: 1; } .children:first-child { width: 100px; } stretch;
  • 27. Flexbox 1 1 100px.container { flex-direction: row; align-items: flex-start; } .children { flex: 1; } .children:first-child { width: 100px; } stretch; column; height: 100px;
  • 28. Flexbox • A Complete guide to Flexbox
 https://css-tricks.com/snippets/css/a-guide-to-flexbox/ • Flexbox Playground
 https://scotch.io/demos/visual-guide-to-css3-flexbox-flexbox-playground • React Native: Flexbox
 https://facebook.github.io/react-native/docs/flexbox.html • W3C: CSS Flexible Box Layout Module Level 1
 http://www.w3.org/TR/css-flexbox-1/
  • 30. 코딩 TidevProject/ TidevProject.xcodeproj
 TidevProjectTests/
 iOS/
 node_modules/ index.ios.js
 package.json 프로젝트 폴더 및 파일 구성 App/ App.js
 TopicList.js TopicListItem.js TopicView.js TopicMixin.js contentTemplate.js
  • 31. 코딩 프로젝트 폴더 및 파일 구성 App/ App.js
 TopicList.js TopicListItem.js TopicView.js TopicMixin.js contentTemplate.js
  • 32. 코딩 프로젝트 폴더 및 파일 구성 App/ App.js
 TopicList.js TopicListItem.js TopicView.js TopicMixin.js contentTemplate.js <WebView />
  • 34. 회고 1. React를 알면 빠르게 만들 수 있다.
 = 모르면 학습 시간이 필요하다. 2. Flexbox 레이아웃과 CSS 비슷한 스타일링은 편하다. 3. 아직 다소 불안정하다.
 - 여전히 수정해야 할 버그가 많다.
 - 다행히 상당히 빠르게 패치가 되고 있다.
 - 크롬 디버거 연결에 안정성 좀... ㅠ_ㅠ 4. 네이티브를 아예 모르면 힘들다.
 - 확장 기능을 사용하려해도 알아야 한다.
 - Objective-C에 대한 눈치 정도라도 있어야 한다.
 - 많이는 몰라도 된다.
  • 35. 오픈 소스로 공개되어 있습니다. 오늘 코드는 http://github.com/taggon/tidev