const removeProduct = (index) => { setProductsArray([ ...products.slice(0, index), ...products.slice(index + 1, products.length) ]); }