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

React Native for Webの使いどころ

nacam403
October 12, 2018

React Native for Webの使いどころ

nacam403

October 12, 2018
Tweet

More Decks by nacam403

Other Decks in Programming

Transcript

  1. React Native for Webͱ͸ʁ React
 ຊՈͷWeb༻ϥΠϒϥϦ React Native
 ReactͰωΠςΟϒΞϓϦΛ࡞ΕΔʢiOS/Androidʣ React

    Native for Web
 ʮReact Native༻ͷίϯϙʔωϯτΛWebͰ΋ಈ͔ͤ·͢ʯ
 ʮʁʁʁɹWeb༻͸࠷ॳ͔Β͋ΔΑͶɾɾɾʁʯ
  2. React Native༻ͷίϯϙʔωϯτ import React from 'react'; import { View, Text

    } from 'react-native'; const App = () => ( <View> <Text>Hello, world!</Text> </View> ); import React from 'react'; const App = () => ( <div> <p>Hello, world!</p> </div> ); React
 div, pͳͲ͕جຊཁૉ React Native
 View, TextͳͲ͕جຊཁૉ
  3. React Native for WebΛ࢖͏ͱ React Native༻ʹॻ͍ͨίϯϙʔωϯτΛWebͰ΋࢖͑Δ
 ʢ࢓૊ΈΛҰݴͰɿView΍TextͳͲΛɺdivͳͲʹม׵͢Δʣ import React from

    'react'; import { View, Text } from 'react-native'; const App = () => ( <View> <Text>Hello, world!</Text> </View> ); ϒϥ΢βͰදࣔͰ͖ͪΌ͏
  4. ϞόΠϧ޲͚WebΞϓϦ͚ͩ։ൃ • React Nativeʹ͸ɺϞόΠϧʹదͨ͠ίϯϙʔ ωϯτ͕ἧ͍ͬͯΔʢScrollView, FlatList …ʣ • for WebΛ࢖ͬͯͦΕΒΛWebʹ༌ೖ͠ɺ


    ϞόΠϧΒ͍͠UIΛ࡞͍ͬͯ͘ • ͍ͭͰʹʮকདྷɺfor WebΛ΍ΊͯReact Native ΞϓϦʹม਎ʯͷ෍ੴʹ΋ͳΔʢݱ࣮ຯ͸ബ͍ʣ
  5. Ξό΢τͳਤͰ੔ཧ Ϋϩε
 ϓϥοτ
 ϑΥʔϜ ୯Ұ
 ϓϥοτ
 ϑΥʔϜ ݱ࣮ຯ͋Δ ϩϚϯؾຯ ωΠςΟϒͱ8FC


    ຊཱͯ ఆ൪ίϯϙʔωϯτ Λڞ௨Խ ࠓ͸8FC͚ͩ
 কདྷωΠςΟϒԽ
 ʢ·ͨ͸ͦͷٯʣ 3FBDU/BUJWF༻ϥΠϒϥϦΛ 8FCʹྲྀ༻ ϞόΠϧ8FC ͚ͩ։ൃ
  6. ·ͱΊ • React Native for WebΛ࢖͏ͱ
 React NativeͷίϯϙʔωϯτΛ
 Webʹྲྀ༻Ͱ͖·͢ʢڞ௨ԽͰ͖·͢ʣ •

    ສೳͰ͸ͳ͍΋ͷͷɺࣗ෼ͨͪʹ߹ͬͨ࢖͍ Ͳ͜Ζ͕ݟ͔ͭΕ͹໾ཱͪ·͢ • WebΞϓϦͷΈͷ։ൃͰ΋͋Γ