LoginSignup
0
0

More than 1 year has passed since last update.

【React】useStateで親から子に値渡し

Posted at

useStateを簡単に

クラスではなく、関数内でもstateを使えるようにするといったところでしょうか。
詳しくは、こちらをご覧ください。

なんでこんな初歩的なことを

親コンポーネントから子コンポーネントにuseStateを使用した値の渡し方がわからなかったため。

早速コード

See the Pen useState by yuichiro (@goorer) on CodePen.

最後に

次回は、useStateでの配列の扱いでも書けたらなと思っています。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0