The Words
container needs to be connected to the store using the connect
method.
We will use both mapStateToProps
and mapDispatchToProps
.
mapStateToProps
should only return one words
property equal to the WORDS
from the state.
mapDispatchToProps
must be an object with properties: dispatchDeleteList
and dispatchDeleteWord
.
The first is equal to the deleteList
method, the second is deleteWord
.
The second TouchableOpacity
in the Words
container should show the modal.
Use the getVisibleModalData
method for this.
The first argument is route.params
.
The second argument should delete the passed list using the dispatchDeleteList
property and then go to the LISTS_SCREEN
screen.
The third argument is a method from useState
.
The FlatList
must have a renderItem
property that returns the Word
component.
Just expand the item
property of the renderItem
argument into the properties of the Word
component.
The dispatchDeleteWord
property of the Word
component must be a function that calls getVisibleModalData
.
The first argument is the item.word
property of the renderItem
argument.
The second dispatchDeleteWord
from the Words
properties.
The third argument is a method from useState
.
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.