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

Use React Hooks to develop a simple app

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers. →
Avatar for Genki Genki
April 24, 2019

Use React Hooks to develop a simple app

React Hooksを使って簡単なShuffle Appを使ってみた!

Avatar for Genki

Genki

April 24, 2019

Other Decks in Technology

Transcript

  1. 天方 元紀 株式会社 ウリドキネット 開発マネージャー TW: @GenkiAma Github: genk1 Rails

    x Vuejsの会社に勤務する、React x Firebaseに興味を持っていろいろ個人開発をして いる非エンジニア。 Web業界に入る前はPepperのアプリケーション開 発や営業、マーケティング業務などやってきた。 今は目下サービスの立ち上げとリリース後のグ ロースで挑戦している。 興味: Firebase x React x JAM stack x 一応Vue
  2. useState とは You might have previously known these as “stateless

    components”. We’re now introducing the ability to use React state from these, so we prefer the name “function components”. これまでstate管理をするにはClass Componentでしかできなかったけど 昔 の Stateless Components => 現: function componentsで出来るように なったってことね!
  3. useEffect とは If you’re familiar with React class lifecycle methods,

    you can think of useEffect Hook as componentDidMount, componentDidUpdate, and componentWillUnmount combined. これまでのClass ComponentにおけるLifecycle、 componentDidMount | DidUpdate | WillUnmount が簡単に使える 機能ね!
  4. useReducer とは An alternative to useState. Accepts a reducer of

    type (state, action) => newState, and returns the current state paired with a dispatch method. (If you’re familiar with Redux, you already know how this works.) ReduxでやっていたようなDispatchが必要になるState管理ができるように なるってことね