Show Buttons
Share On Facebook
Share On Twitter
Share On Google Plus
Share On Linkdin
Share On Reddit
Share On Stumbleupon
Contact us
Hide Buttons

Generating container components with connect utility in react redux app

Pre­sen­ta­tional com­po­nent spec­i­fies look of the com­po­nent where as Con­tainer com­po­nent spec­i­fies how the behav­ior of it. I would rec­om­mend read­ing Pre­sen­ta­tion vs con­tainer com­po­nents.

In well archi­tected react-redux app, Con­tainer com­po­nents have two major responsibilities:

  1. Re-render the pre­sen­ta­tional com­po­nent when store updates
  2. Define the behav­ior of pre­sen­ta­tional com­po­nents by pass­ing the nec­es­sary data and dis­patch call­backs to update the store

Gen­er­at­ing con­tain­ers com­po­nent with­out con­nect from react-redux

Gen­er­at­ing con­tain­ers com­po­nent with con­nect from react-redux

  • In this approach, the con­tainer com­po­nents do not need to access the redux store via con­text. Hence, they do not need to spec­ify the con­text­Type explicitly.

You may also like...