i want to store the product id on a state but when i first click it show empty array, how can i fix this?