LoginSignup
0
1

More than 3 years have passed since last update.

備忘録: 多分こういうことかな、reduxのthis.propsバケツリレー回避

Posted at

下記の記事にバケツリレーについて言及している部分があります。
(Mentioning fragment about 'Bucket Relay' at bottom article.)
そこを自分なりに書いてみました。
(I wrote it so that I could easily understand for me.)
stateをどのコンポーネントからも参照できる利点が少し分かった気がします。
(I feel like a little understand about merit of can reference state from any component.)
https://programmagick.com/chapter?course=react_tutorial&slug=react_basis_props_state#prop_drilling

書いたコード(Wrote code)

中身のreducers/isLoggedIn.jsのstateを変えることで見た目が一気に変わります。
(Appearance will change by state in reducers/isLoggedIn.js.)
https://codesandbox.io/s/reactredux-ke1f1?fontsize=14

※因みにログインボタンは動きません。

0
1
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
1