react-firebase-hooks icon indicating copy to clipboard operation
react-firebase-hooks copied to clipboard

Fix useLoadingValue perf issue

Open wong2 opened this issue 2 years ago • 0 comments

I'm using useAuthState in my application and found it causing my component re-render infinitely, after some debugging, I noticed the problem is in useLoadingValue, the returned setValue and setError are changing every time it re-run. (useMemo doesn't help here). We need to use useCallback to prevent them from changing.

wong2 avatar Jun 17 '22 12:06 wong2