![]() They don't have to be aware of Redux at all. The first set is the presentational components. These are concerned with how things look. ![]() Basically, we can break our application up into two sets of components. One of the main ideas behind this package is the idea of presentational components and container components. You can read a little bit more about the ideas behind this package if you head over to the Redux documentation. Now it would be nice if there was some way we could give all of our components access to the store without having a global variable, and without manually passing it around.Īnd the truth is, there is a way. That means that we would have to use it from within this file or we'd have to start passing it around from this file to other files, which will become very messy.Īlso, if we have a lot of nested components, it means that if an in-between component doesn't really need the store but one of its children does, we'll have to pass it to that in-between component anyway because it needs it so that it can pass it to its child. One of the simplest reasons is that it's not actually global-it's only accessible from within this file. However, having a global store like this is not great for a lot of reasons. So far, we have a global store object that we can access directly in the section where we are assigning properties to our sidebar. Remember, the Redux store holds all the state for your entire application. This means that most, if not all, of our components need to be able to access the store in some way. However, almost all of our components need to work with the store, either by reading specific states or by dispatching actions back to the store. In earlier parts of this course, we built a sample app using React and Redux.
0 Comments
Leave a Reply. |