useState bug????

i want to store the product id on a state but when i first click it show empty array, how can i fix this?
1 Reply
prakhar_goel
prakhar_goel2y ago
setState is async operation checking the value immediately after setting it will give previous value

Did you find this page helpful?