ReactNote
ReactNote copied to clipboard
hooks与类组件开发方式讨论:容器组件与UI组件
https://medium.com/nmc-techblog/why-you-should-stop-using-the-container-presentational-pattern-in-redux-29b112406128
容器组件订阅了 redux 中的一大块数据,分发给各个UI组件,导致了子组件的重新渲染,其实在类组件中也会有这样的问题,一般的解决办法是拆分以及使用 useMemo,或者 React.memo 来做。但是下一 issue(文章) 会说到 useMemo 的一些需要注意的地方。