SlideShare a Scribd company logo
入門 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

PDF
Node.js+MongoDB in SPA
PPTX
Blog=pelican+bit bucket+docker
PPTX
AWS CLIでEC2の利用料金を節約する
PPTX
Repaint & reflow
PDF
Introduction to React
PPTX
Synchronizing application state using Virtual DOM trees
PPTX
Intro to Web Map APIs
PPTX
Introduction to React
Node.js+MongoDB in SPA
Blog=pelican+bit bucket+docker
AWS CLIでEC2の利用料金を節約する
Repaint & reflow
Introduction to React
Synchronizing application state using Virtual DOM trees
Intro to Web Map APIs
Introduction to React

Viewers also liked (20)

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

Similar to React entry (20)

PDF
React introduntion
PPTX
React入門
PDF
フロントエンド開発入門(React).pdf
PPTX
SYSTEMI勉強会まとめ資料(React基礎まとめ)
PDF
Intoroduction to React.js
PPTX
今からでも遅くない! React事始め
PDF
React.jsでクライアントサイドなWebアプリ入門
PDF
React.js + Flux入門 #scripty02
PDF
React入門-JSONを取得して表示する
PDF
React vtecx20171025
PDF
Create android app can send SMS and Email by React Natice
PPTX
Hello, React!! まで導く Reactの基礎
PPTX
Reactに触れてみた
PDF
Start React with Browserify
PPTX
PDF
ReactJSの開発導入について
PDF
SIROK技術勉強会 #1 「Reactってなんだ?」
PPTX
React vtecx20170920
PPTX
まだDOM操作で消耗してるの?
PPTX
20210316_myfirst react
React introduntion
React入門
フロントエンド開発入門(React).pdf
SYSTEMI勉強会まとめ資料(React基礎まとめ)
Intoroduction to React.js
今からでも遅くない! React事始め
React.jsでクライアントサイドなWebアプリ入門
React.js + Flux入門 #scripty02
React入門-JSONを取得して表示する
React vtecx20171025
Create android app can send SMS and Email by React Natice
Hello, React!! まで導く Reactの基礎
Reactに触れてみた
Start React with Browserify
ReactJSの開発導入について
SIROK技術勉強会 #1 「Reactってなんだ?」
React vtecx20170920
まだDOM操作で消耗してるの?
20210316_myfirst react
Ad

React entry