diegohaz / arc

React starter kit based on Atomic Design
https://arc.js.org
2.91k stars 295 forks source link

[redux] Containers and presenting information differently #328

Open jwkellyiii opened 6 years ago

jwkellyiii commented 6 years ago

I am intrigued to hear how other people are handling this situation:

I have some data, lets call it users. In one place in my application I want to display the users as a list. I.E.

 - user1
 - user2
 - user3

I created a Container that reads the data and renders a UserList component. Now I have another place in the same application that I want to display users in a table. I.E.

| id | name | other |
---------------------
| 1  | user1 | xxxxx |
| 2  | user2 | xxxxx |
| 3  | user3 | xxxxx |

My question. Are people really creating another container just to render a UserTable component? Or are they making a "UserDisplay" component that is somewhat generic that can render the list of users differently (in this case as a list and as a table)?

Thanks!