Hi,
If I follow the documentation of ResourceList (https://polaris.shopify.com/components/lists/resource-list#navigation) the code should display the list item as per the example.
Instead, because of the render function being empty, nothing is rendered. If I remove the renderFunction (hoping it would default to some sane defaults), it throws an exception due to missing render item function.
EDIT : got it, the doc is not up to date with this document: https://github.com/Shopify/polaris/tree/master/src/components/ResourceList
I leave this issue open for now :).
Hey @bakura10, you鈥檙e right. Looks like an issue with the polaris site鈥攖he example code is loaded directly from that readme file, so something must be displaying wrong. We鈥檙e looking into it.
It looks like the renderItem function needs to be updated from:
renderItem={() => {}}
to
renderItem={(item, index) => {
return <ResourceList.Item key={index} {...item} />;
}}
You鈥檙e totally right.
The content for each component page on polaris.shopify.com is parsed from the README in the codebase. The one for ResourceList is correct, so it looks like it鈥檚 not getting parsed correctly.
We鈥檒l get this fixed. Thanks for flagging it!
This is resolved in the latest resource list documentation: https://polaris.shopify.com/components/lists/resource-list
Most helpful comment
It looks like the renderItem function needs to be updated from:
to