Skip to content

Commit cb3818a

Browse files
committed
Fix warning that "dispatch" should be included as dependency of useEffect
1 parent d09d324 commit cb3818a

File tree

1 file changed

+1
-1
lines changed
  • src/components/MainLayout/components

1 file changed

+1
-1
lines changed

src/components/MainLayout/components/Cart.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default function Cart() {
2121
).then(({ data: { data: { cart } } }) => {
2222
dispatch(updateFromApi(cart))
2323
});
24-
}, []);
24+
}, [dispatch]);
2525
const cartItems = useSelector(selectCartItems);
2626
const badgeContent = cartItems.length || undefined;
2727

0 commit comments

Comments
 (0)