Answer the question
In order to leave comments, you need to log in
What about useMemo and dependency?
There is a memoized function.
An example in which there are 3 dependencies value1, value2, value3.
But we use only 2 dependencies value1, value2 in the function.
We get
the warning react hook usememo has an unnecessary dependency "value3" what are the solutions?
const memoizedValue = useMemo(() => computeExpensiveValue(value1, value2 ), [value1, value2, value3]);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question