Skip to content
Advertisement

React Hook useCallback received a function whose dependencies are unknown. Pass an inline function instead. useMemo doesn’t work

How can i fix this? I see question like this where people said that useMemo can help. But this is not about like that situation and useMemo fix doesn’t work and create just more bugs.

JavaScript

Advertisement

Answer

can you try this instead? useCallback takes two params.. an inline function, and a dependency array.

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement