react redux: containers composition

后端 未结 2 1827
梦毁少年i
梦毁少年i 2021-02-08 03:37

I am building an React+Redux application, I come to the point where I am considering to use a container inside another container. I am asking myself if this is a good approach,

2条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-08 03:55

    It's not easy to find which component should stay "dumb" and which component should be aware of application and become a container. I don't think it's a problem / anti-pattern to use a container in another one. If a part of your application is used on different pages it can be a container, be connected and use in differents pages/containers, Just be aware : this "container component" will specific to this application

提交回复
热议问题