• Class components allows you to use additional features such as local state and lifecycle hooks. Also, to enable your component to have direct access to your store and thus holds state. 类组件允许您使用其他特性,比如本地状态和生命周期挂钩。 另外,为了使您的组件能够直接访问您的存储,从而保存状态。
  • When your component just receives props and renders them to the page, this is a stateless component, for which a pure function can be used. These are also called dumb components or presentational components. 当您的组件只是接收道具并将它们呈现到页面时,这是一个无状态组件,可以使用纯函数。 这些组件也称为哑组件或表象组件。