After creating a filter function in React to organize images by category, I encountered an issue where the filtered images weren't centered as I wanted them to be. I am now looking for a way to integrate centering into the filtering process so that when my function runs, the images are both filtered and centered.
I have made attempts to implement this feature but haven't yet found a solution. Any help would be greatly appreciated. Thanks!
const filterModel = (category) => {
if(category === 'all') {
setModelsCards(Models);
return;
}
const newModel = Models.filter((model)=> model.category === category);
setModelsCards(newModel);
}