2019-12-29から1日間の記事一覧

reduxのstateから取り出した値はコンポーネントで変更してはならない

現象 ComponentAでstate.datasを使用しているとき、 ComponentBの中でstate.datasの値(または配列)を操作すると、ComponentAが正しくレンダリングされない。 対処法 Object.assignでstate.datasをコピーする。