facebook

React Redux Connect API to create container components

React Redux Connect API to create container components
Average rating: 0
(0 votes)

Thanks! You’ve rated this material!

We assume you already have a fundamental understanding of React and the Redux architecture and API. Redux is a predictable state container for JavaScript apps ranging from Vanilla apps to framework apps. And now we are going to briefly explain more how to use React Redux Connect API to create container components.

The react-redux package provides React bindings for the Redux state container making it very easy for a React application to be connected to a Redux store. This allows you to separate your React application components based on their connection to the Redux store as follows:

  1. Presentational Components — These components are only concerned with how things look and are not aware of the Redux state. They get their data from props and may trigger callbacks passed to them via props.
  2. Container Components — These components are responsible for how things work and are fully aware of the Redux state. They are often created using React Redux and may dispatch Redux actions. They also subscribe to changes in the Redux state.

You can learn more about this separation of concerns here.

Check your knowledge by reading Storybook with React and Redux. Master your skills!

p.s. In the end of the day, remember this quote: ‘Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.’ That makes a lot of sense!

Rate this article, if you like it

Thanks! You’ve rated this material!

Got a project? Let's discuss it!

Mailing & Legal Address

Syndicode Inc. 340 S Lemon Ave #3299, Walnut CA, 91789, USA

Visiting & Headquarters address
Kyiv Sofiivska 1/2a, 01001, Kyiv, Ukraine
Dnipro Hlinky 2, of. 1003, 49000, Dnipro, Ukraine
Email info@syndicode.com
Phone (+1) 9035021111