A space to discuss online store customization, theme development, and Liquid templating.
Unhandled Runtime Error
Error: Your resource does not directly contain an id. Pass a ''resourceIDResolver" to "useIndexResourceState"
on click i got this error
how use resourceIDResolver
I am getting this error while i tried to select all product in table.
I am new in polaris please help.
i am setting product array like this id is inside the node but how to pass id directly by using this resourceIDResolver
Solved! Go to the solution
This is an accepted solution.
resourceIDResolver a function that returns id.
const resourceIDResolver = (products) => {
return products.node.id;
};
const {
selectedResources,
allResourcesSelected,
handleSelectionChange,
} = useIndexResourceState(products, {
resourceIDResolver,
});
This is an accepted solution.
resourceIDResolver a function that returns id.
const resourceIDResolver = (products) => {
return products.node.id;
};
const {
selectedResources,
allResourcesSelected,
handleSelectionChange,
} = useIndexResourceState(products, {
resourceIDResolver,
});
Can I ask that products.node.id is a list of id?