Do not add each item data as props but wrap it in a single data prop. #177
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What kind of this PR?
Developper experience improvement.
Other information:
In his question, #176 @MOSMekawy asks how to pass props to the list item component.
This is true that using list of complex objects make it a pain to use. Indeed, every info if the source object is passed as an indivual prop in the component so you have to list them all. For various reasons, this can be fastidious to declare and manipulate.
In this pull request, I have transmitted the whole data-source object under the "data" props.
So you can conveniently declare one Object props in your listed component and use it as you normally do.
Fetching a list of something from an API and listing it (and using it in a view component within the list) is then made simpler.