V
V
Viktor2019-11-13 21:03:08
React
Viktor, 2019-11-13 21:03:08

How will useEffect dependencies work?

Hello. I have the following code in the component:
5dcc44a795f09424560299.png
When the onChangeSelect event happens, I change two dependencies specified in useEffect => params.page and paramsFilters. What dependency will work in this case useEffect. I checked through the console, it works once.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Dozmorov, 2019-11-14
@Dozalex

Why does he have to work twice? Two of its dependencies were changed at the same time (within one render), it worked if at least one was changed. All right.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question