V
V
vovashaplin2020-06-11 19:31:38
React
vovashaplin, 2020-06-11 19:31:38

Are state changes late?

Guys, I have a list of products with a paginator, when the number of products decreases due to the selection of categories, I want to change the currentPage to the first one, but since I have it dispatched, the changes do not immediately come to the paginator or do not come at all, how can I solve the problem?
Here are the required files (components/Paginator, components/Category, context/ItemsState)
https://github.com/ScrollPage/shop-test/tree/maste...

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question