To display the data, you must first prepare.
To do this, export the preparedDetails
function from the file: src/containers/Words/Word/helpers.js
.
This function must receive one meanings
argument.
meanings
is an array of objects that describe a word.
Each object consists of the strings def
, example
and an array of strings synonyms
.
When receiving such an array, the preparedDetails
function should return an object with the following fields: defs
, examples
, synonyms
.
defs
must be an array of def
field values of all meanings
elements.
examples
must be an array of example
field values of all meanings
elements.
synonyms
must union the synonyms
arrays of all meanings
elements.
The values for defs
, examples
and synonyms
must be unique.
The details container in a Word
component should display an array of preparedDetails
fields.
This method must be called with the meanings
property of the Word
component.
For each key, the Details
component should be rendered with the keyDetail
property equal to the current key.
The options
property must equal the value of this key in the object obtained from preparedDetails
.
The word
property must also be passed through.
In the Words
container, specify the data
property for the FlatList
.
It must equal the filtered words
property.
Only those elements should remain whose listKey
property is equal to the route.param
of the container.
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.