Let’s connect redux and navigation to our application
To do this, import the src/components/Navigator
component and the Provider
component from react-redux
.
Now, after the fonts are loaded in the <App />
component, the navigator wrapped by the provider should be returned.
The provider needs to specify the store
property, the value of which is imported from src/external/redux/store.js
.
Now the Lists
component needs to be connected to the store. To do this, import connect
from react-redux
in the src/containers/Lists.index
file.
The connect
method must have only one argument, the mapStateToProps
function.
mapStateToProps
must return an object with three fields lists
, wordsCount
, listsCount
.
Pass the Lists
component to the function returned by the connect
method.
The lists
field must contain the LISTS
field from the repository state.
The fields wordsCount
, listsCount
are the length of the WORDS
and LISTS
arrays from the storage state.
The text element above the Lists
text in the Lists
component should display the listsCount
property.
The text element above the Words
text in the Lists
component must display the wordsCount
property.
This task is part of the Full-Stack JavaScript Course.
If you have any issues with it, you can ask for community help below the post.
Feel free to help others if you’ve already solved the task.