SlideShare a Scribd company logo
1 of 18
Download to read offline
入門 React
2015-08-28 miuranobuaki
React
〔ある作用に対して〕
作用し合う,反応を示す
• シンプルで利用が容易
• Virtual DOMによるレンダリング効率向上
• コンポネント指向で保守性、可読性が高い
http://facebook.github.io/react/
Virtual DOM
• DOMを直接操作しない
• メモリ上にDOMと同じ構造のVDOMを構築
• Viewの状態変化を検知すると状態変化前後のVDOMを比較
• 差分をパッチとしてオリジナルのDOMに当て、効率的なレンダリングを実現
要素の親も
変更されたことがわかる
最速というわけではない
Virtual DOMを使った差分更新は
すべてをDOM書き換えるよりは高速
という意味
コンポーネント指向
値 -> DOMの変換をする
再利用を前提にする
変換処理だけをする(関数みたいな感じ)
• 冪等性と疎結合が担保
• テスタブル
• カジュアルな変更・削除が可能
データの流れを一方向に保つ
とりあえず動かそう
FacebookのJSを読み込む
ダウンロードする
<script src="http://fb.me/react-0.13.3.js"></script>
<script src="http://fb.me/JSXTransformer-0.13.3.js"></script>
http://facebook.github.io/react/
OR
HelloWold
<title>Hello React!</title>
<script src="react.js"></script>
<script src="JSXTransformer.js"></script>
</head>
<body>
<div id="example"></div>
<script type="text/jsx">
React.render(
<h1>Hello, world!</h1>, document.getElementById('example')
);
</script>
</body>
</html>
コンパイル
1.brew install npm
2.npm install -g react-tools
3.jsx --watch src/ build/
JSX (JavaScriptXml)
JSX
<script type="text/jsx">
React.render(
<h1>Hello, world!</h1>, document.getElementById('example')
);
</script>
HTMLやXMLみたいな感じでVirtual DOMを表現
Tutorial
入門しきれなかったorz
また続きをやります。。。
・GET STANDARD
http://facebook.github.io/react/docs/getting-started.html
・Tutorial
http://facebook.github.io/react/docs/tutorial.html
・Thinking in React
http://facebook.github.io/react/docs/thinking-in-react.html

More Related Content

Viewers also liked

Digitaalisesti vaikuttavaksi. @HelsinkiUniUX -projektin tarina
Digitaalisesti vaikuttavaksi. @HelsinkiUniUX  -projektin tarina Digitaalisesti vaikuttavaksi. @HelsinkiUniUX  -projektin tarina
Digitaalisesti vaikuttavaksi. @HelsinkiUniUX -projektin tarina University of Helsinki
 
Why and How to Use Virtual DOM
Why and How to Use Virtual DOMWhy and How to Use Virtual DOM
Why and How to Use Virtual DOMDaiwei Lu
 
React.js - The Dawn of Virtual DOM
React.js - The Dawn of Virtual DOMReact.js - The Dawn of Virtual DOM
React.js - The Dawn of Virtual DOMJimit Shah
 
ReactNativeを語る勉強会
ReactNativeを語る勉強会ReactNativeを語る勉強会
ReactNativeを語る勉強会yohei sugigami
 
From Back to Front: Rails To React Family
From Back to Front: Rails To React FamilyFrom Back to Front: Rails To React Family
From Back to Front: Rails To React FamilyKhor SoonHin
 
React Native - Workshop
React Native - WorkshopReact Native - Workshop
React Native - WorkshopFellipe Chagas
 
Introduction to ReactJS
Introduction to ReactJSIntroduction to ReactJS
Introduction to ReactJSHoang Long
 
React.js in real world apps.
React.js in real world apps. React.js in real world apps.
React.js in real world apps. Emanuele DelBono
 
[@NaukriEngineering] Git Basic Commands and Hacks
[@NaukriEngineering] Git Basic Commands and Hacks[@NaukriEngineering] Git Basic Commands and Hacks
[@NaukriEngineering] Git Basic Commands and HacksNaukri.com
 
An Introduction to ReactJS
An Introduction to ReactJSAn Introduction to ReactJS
An Introduction to ReactJSAll Things Open
 
ReactJS presentation
ReactJS presentationReactJS presentation
ReactJS presentationThanh Tuong
 
Intro to react native
Intro to react nativeIntro to react native
Intro to react nativeModusJesus
 
React - render() to DOM - Boris Dinkevich - Codemotion Milan 2016
React - render() to DOM - Boris Dinkevich - Codemotion Milan 2016React - render() to DOM - Boris Dinkevich - Codemotion Milan 2016
React - render() to DOM - Boris Dinkevich - Codemotion Milan 2016Codemotion
 
DOM Features You Didn’t Know Existed
DOM Features You Didn’t Know ExistedDOM Features You Didn’t Know Existed
DOM Features You Didn’t Know ExistedFITC
 
React + Redux Introduction
React + Redux IntroductionReact + Redux Introduction
React + Redux IntroductionNikolaus Graf
 
React JS and why it's awesome
React JS and why it's awesomeReact JS and why it's awesome
React JS and why it's awesomeAndrew Hull
 

Viewers also liked (20)

Digitaalisesti vaikuttavaksi. @HelsinkiUniUX -projektin tarina
Digitaalisesti vaikuttavaksi. @HelsinkiUniUX  -projektin tarina Digitaalisesti vaikuttavaksi. @HelsinkiUniUX  -projektin tarina
Digitaalisesti vaikuttavaksi. @HelsinkiUniUX -projektin tarina
 
Why and How to Use Virtual DOM
Why and How to Use Virtual DOMWhy and How to Use Virtual DOM
Why and How to Use Virtual DOM
 
React.js - The Dawn of Virtual DOM
React.js - The Dawn of Virtual DOMReact.js - The Dawn of Virtual DOM
React.js - The Dawn of Virtual DOM
 
ReactNativeを語る勉強会
ReactNativeを語る勉強会ReactNativeを語る勉強会
ReactNativeを語る勉強会
 
Pjax 深入淺出
Pjax 深入淺出Pjax 深入淺出
Pjax 深入淺出
 
React
ReactReact
React
 
From Back to Front: Rails To React Family
From Back to Front: Rails To React FamilyFrom Back to Front: Rails To React Family
From Back to Front: Rails To React Family
 
React Native - Workshop
React Native - WorkshopReact Native - Workshop
React Native - Workshop
 
Introduction to ReactJS
Introduction to ReactJSIntroduction to ReactJS
Introduction to ReactJS
 
React.js in real world apps.
React.js in real world apps. React.js in real world apps.
React.js in real world apps.
 
[@NaukriEngineering] Git Basic Commands and Hacks
[@NaukriEngineering] Git Basic Commands and Hacks[@NaukriEngineering] Git Basic Commands and Hacks
[@NaukriEngineering] Git Basic Commands and Hacks
 
An Introduction to ReactJS
An Introduction to ReactJSAn Introduction to ReactJS
An Introduction to ReactJS
 
ReactJS presentation
ReactJS presentationReactJS presentation
ReactJS presentation
 
Intro to react native
Intro to react nativeIntro to react native
Intro to react native
 
React - render() to DOM - Boris Dinkevich - Codemotion Milan 2016
React - render() to DOM - Boris Dinkevich - Codemotion Milan 2016React - render() to DOM - Boris Dinkevich - Codemotion Milan 2016
React - render() to DOM - Boris Dinkevich - Codemotion Milan 2016
 
DOM Features You Didn’t Know Existed
DOM Features You Didn’t Know ExistedDOM Features You Didn’t Know Existed
DOM Features You Didn’t Know Existed
 
Effective ES6
Effective ES6Effective ES6
Effective ES6
 
React + Redux Introduction
React + Redux IntroductionReact + Redux Introduction
React + Redux Introduction
 
ES6: The Awesome Parts
ES6: The Awesome PartsES6: The Awesome Parts
ES6: The Awesome Parts
 
React JS and why it's awesome
React JS and why it's awesomeReact JS and why it's awesome
React JS and why it's awesome
 

Similar to React entry

JavaFX + NetBeans環境におけるJenkinsの活用(Jenkins第六回勉強会)
JavaFX + NetBeans環境におけるJenkinsの活用(Jenkins第六回勉強会)JavaFX + NetBeans環境におけるJenkinsの活用(Jenkins第六回勉強会)
JavaFX + NetBeans環境におけるJenkinsの活用(Jenkins第六回勉強会)Ryusaburo Tanaka
 
PostgreSQLの連携!クラウド移行!負荷分散!バックアップ!DBMotoで一挙解決!
PostgreSQLの連携!クラウド移行!負荷分散!バックアップ!DBMotoで一挙解決!PostgreSQLの連携!クラウド移行!負荷分散!バックアップ!DBMotoで一挙解決!
PostgreSQLの連携!クラウド移行!負荷分散!バックアップ!DBMotoで一挙解決!株式会社クライム
 
Mithril - 軽量/高速なMVCフレームワーク
Mithril - 軽量/高速なMVCフレームワークMithril - 軽量/高速なMVCフレームワーク
Mithril - 軽量/高速なMVCフレームワークsairoutine
 
データベース勉強会 In 広島 mongodb
データベース勉強会 In 広島  mongodbデータベース勉強会 In 広島  mongodb
データベース勉強会 In 広島 mongodbRyuji Tamagawa
 
Grid application テンプレートを紐解く
Grid application テンプレートを紐解くGrid application テンプレートを紐解く
Grid application テンプレートを紐解くKazuhide Maruyama
 
Daisukei vsug ef
Daisukei vsug efDaisukei vsug ef
Daisukei vsug efvsug_jim
 
Continuous delivery chapter13
Continuous delivery chapter13Continuous delivery chapter13
Continuous delivery chapter13favril1
 
React + Reduxで作る対話AI
React + Reduxで作る対話AIReact + Reduxで作る対話AI
React + Reduxで作る対話AIKentaro Tada
 
Djangoとは
DjangoとはDjangoとは
DjangoとはGomamatsu
 

Similar to React entry (10)

Reactのおさらい
ReactのおさらいReactのおさらい
Reactのおさらい
 
JavaFX + NetBeans環境におけるJenkinsの活用(Jenkins第六回勉強会)
JavaFX + NetBeans環境におけるJenkinsの活用(Jenkins第六回勉強会)JavaFX + NetBeans環境におけるJenkinsの活用(Jenkins第六回勉強会)
JavaFX + NetBeans環境におけるJenkinsの活用(Jenkins第六回勉強会)
 
PostgreSQLの連携!クラウド移行!負荷分散!バックアップ!DBMotoで一挙解決!
PostgreSQLの連携!クラウド移行!負荷分散!バックアップ!DBMotoで一挙解決!PostgreSQLの連携!クラウド移行!負荷分散!バックアップ!DBMotoで一挙解決!
PostgreSQLの連携!クラウド移行!負荷分散!バックアップ!DBMotoで一挙解決!
 
Mithril - 軽量/高速なMVCフレームワーク
Mithril - 軽量/高速なMVCフレームワークMithril - 軽量/高速なMVCフレームワーク
Mithril - 軽量/高速なMVCフレームワーク
 
データベース勉強会 In 広島 mongodb
データベース勉強会 In 広島  mongodbデータベース勉強会 In 広島  mongodb
データベース勉強会 In 広島 mongodb
 
Grid application テンプレートを紐解く
Grid application テンプレートを紐解くGrid application テンプレートを紐解く
Grid application テンプレートを紐解く
 
Daisukei vsug ef
Daisukei vsug efDaisukei vsug ef
Daisukei vsug ef
 
Continuous delivery chapter13
Continuous delivery chapter13Continuous delivery chapter13
Continuous delivery chapter13
 
React + Reduxで作る対話AI
React + Reduxで作る対話AIReact + Reduxで作る対話AI
React + Reduxで作る対話AI
 
Djangoとは
DjangoとはDjangoとは
Djangoとは
 

React entry