Upgrade to Pro — share decks privately, control downloads, hide ads and more …

React事始め

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
Avatar for nabeliwo nabeliwo
September 10, 2016

 React事始め

Gizumo社内勉強会「React」勉強会用の資料です。

Avatar for nabeliwo

nabeliwo

September 10, 2016
Tweet

More Decks by nabeliwo

Other Decks in Programming

Transcript

  1. React is 何 • Viewライブラリ✨ • facebook作 • https://facebook.github.io/react/ •

    Not フレームワーク • But フレームワーク比較によく出てくるやつ • Reactを含むアーキテクチャを丸々ひっくるめて語られ ることが多い
  2. Reactその使われっぷり • Facebook • Instagram • Uber • Netflix •

    Airbnb • Yahoo • Twitter Mobile • Abema.TV • Qiita • etc… • ReactNative for iOS • ReactNative for Android • ReactNative for Windows web以外でも…
  3. Reactその特徴 • JUST THE UI • VIRTUAL DOM • DATA

    FLOW 公式サイトより… 昔 今 • Declarative • Component-Based • Learn Once, Write Anywhere
  4. 1 Hello World • Component • state • jsx •

    reactのrender • react-domの render
  5. おまけ2 〜Stage〜 • Stage is 何
 TC39というECMAScriptの策定をしている専門委員会 があって、その中でESの新しい機能が提案されると、 それにはStageと呼ばれる5段階のラベルがつけられま す(0〜4)。Stage

    4になった提案は次期ECMAScriptの 仕様に取り込まれます。 • 提案段階の機能を使うには
 BABELのpresetにbabel-preset-stage-0というのをか ませると、全ての提案段階の機能を使うことができます。 でもあんまりよくないよ。
  6. おまけ3 〜Stage詳しく〜 • Stage 0 Strawman - アイディア
 ただのアイディアです。 •

    Stage 1 Proposal - 提案
 プロポーザルの目的や解決方法を示している。Polyfillやデモ等を用いて解説し ている。 • Stage 2 Draft - ドラフト
 いわゆるドラフト。ECMAScript標準と同じルールでAPIや構文、セマンティッ クについて説明していなければならない。 • Stage 3 Candidate - 仕様書と同じ形式
 仕様は完成した状態。ECMAScriptのエディタのチェックが必要。 • Stage 4 Finished 策定完了
 ECMAScriptへ取り込まれる準備が完了したことを示す状態。 詳細: https://azu.github.io/slide-what-is-ecmascript/slide/12.html
  7. 5 ComponentのLifecycle • componentWillMount => DOM展開前 • componentDidMount => DOM展開後

    • componentWillReceiveProps => Props更新前 • shouldComponentUpdate => componentのrerender 前。パフォーマンスチューニング用。 • componentWillUpdate => componentの更新前 • componentDidUpdate => componentの更新後 • componentWillUnmount => DOM削除前 Componentの状態の変化に合わせて呼ばれるメソッド群