Skip to content

Do not add each item data as props but wrap it in a single data prop. #177

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 14, 2020

Conversation

dclause
Copy link
Contributor

@dclause dclause commented Apr 13, 2020

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.

@tangbc tangbc merged commit d226a7a into tangbc:master Apr 14, 2020
@tangbc
Copy link
Owner

tangbc commented Apr 14, 2020

Also need to make some changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants