Skip to content

components与containers的看法 #1

Description

@giscafer

大概看了下代码,随便说一下而已:

这里containers文件夹其实没有存在的必要了,你把数据管理和业务逻辑都放到了components了。并没有像一些教程里边说的components 纯粹用来做组件渲染,状态无关。

我是比较喜欢这样:

UI组件 components (纯组件,无状态,所有参数通过Props传,可复用性,不会用到和react-redux有关的东西)
容器组件 containers (用来负责管理数据和业务逻辑,react-redux 链接components)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions