タグ

ブックマーク / qiita.com/tatane616 (1)

  • React Hooksの概要 - Qiita

    Hooksは、classを記述せずにstateやその他のReactの機能を使えるようにしたもので、今は提案段階です。RFCはこちら 現在はReact v16.7.0-alphaで試せます。 Hooks導入の動機はこちら https://qiita.com/tatane616/items/9d667e32b6f82f9f7a9f State Hook よくあるボタンを押すとカウントが増えていくサンプルです。 import { useState } from 'react'; function Example() { // Declare a new state variable, which we'll call "count" const [count, setCount] = useState(0); return ( <div> <p>You clicked {count} times

    React Hooksの概要 - Qiita
    igrep
    igrep 2018/10/31
    React門外漢なんだけど、関数コンポーネントの中でいろいろできるようにしよう、という話であってる?
  • 1