RC4Community
RC4Community copied to clipboard
Create a data-supplier component that wraps a collection of others
Investigate into the possibility of creating a component that takes datasource (strapi, URL to JSON, URL to CSV) and populate its children components iteratively with that data. Without:
- touching or modifying the styling of its children
- having any major assumption about its childrren (except perhaps an exported data population method)
Hi @Sing-Li , could you give me an example? I would like to work on this issue.
@abhinavkrin Please see this ...
https://github.com/RocketChat/RC4Community/blob/master/app/components/infotiles.js#L6
Simplified to:
<DataLoader id="dl1" src="strapi://infotiles">
<Infotile title={dl1.data.1.title} desc={dl1.data.1.desc} />
<Infotile title={dl1.data.2.title} desc={dl1.data.2.desc} />
<Infotile title={dl1.data.3.title} desc={dl1.data.3.desc} />
<Infotile title={dl1.data.4.title} desc={dl1.data.4.desc} />
</DataLoader>
Hope you get the idea.