You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// 'setLoadingArray' checks an element in our 'loadingArray' local state and compares it with passed in boolean argument. If they don't match, we update our local state replacing the selected element with the boolean argument
57
-
if(loadingArray[i]!==value){
58
-
// this conditional helps us avoid unecessary state changes if the element and the value are already the same
// 'setLoadingArray' checks an element in our 'loadingArray' local state and compares it with passed in boolean argument. If they don't match, we update our local state replacing the selected element with the boolean argument
56
+
if(loadingArray[i]!==value){
57
+
// this conditional helps us avoid unecessary state changes if the element and the value are already the same
58
+
constloadingArrayClone=[...loadingArray];
59
+
loadingArrayClone[i]=value;
60
+
setLoading(loadingArrayClone);
63
61
}
62
+
}
64
63
65
64
if(titleTracker.current!==currentTitle){
66
65
// if the current tab changes/reloads, we reset loadingArray to it's default [true, true, true]
0 commit comments