To understand how the Redux rules you need to vkurivat React.
At least to not be afraid of props.
Have you React. It's all just JS objects.
- so lets write the engine jsx, which React uses it.
As the structure component, you have to think how to update components in another part of the page.
The principle is this: if a component is updated when new properties - props or when changing its state object - state.
You update far apart the components you need to consider what and where properties are coming to the traverse function, which will cause a redraw.
He does not call to abandon the state.
But there is a General data container. And when the data is changing - and changing components that display these data.
When you need to change something - cause a dispatch
is a special feature of reducer
reacts to it and changes the data as you need. When data is replaced by a component Propvider
- causes the render from its child component (the one that wraps the Provider).
<mycomponent>//Here Provider icing (write) the new props.
He writes that the global store and all the components for which changed data preresults.mapStateToProps
- specifies what part of this global repository will provide the provider.
If you have it is:
If mapStateToProps return
the Provider in the props of his descendant icing is: store: store.chunkStore
. And you're going to go in to the store, but there will be only a part of the chunkStore (not the whole object, and its field).mapDispatchToProps
- because subscribe not, it returns functions that can inside to call dispatch()
action - describes what you want to change. What field and what data to put inside.