Skip to content

Commit

Permalink
chore: remove useCallback in fetching memo list
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnyjoygh committed Dec 7, 2024
1 parent 5a83f0c commit cb569c9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions web/src/components/PagedMemoList/PagedMemoList.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Button } from "@usememos/mui";
import { ArrowDownIcon, LoaderIcon } from "lucide-react";
import { useCallback, useEffect, useState } from "react";
import { useEffect, useState } from "react";
import PullToRefresh from "react-simple-pull-to-refresh";
import { DEFAULT_LIST_MEMOS_PAGE_SIZE } from "@/helpers/consts";
import useResponsiveWidth from "@/hooks/useResponsiveWidth";
Expand Down Expand Up @@ -45,11 +45,11 @@ const PagedMemoList = (props: Props) => {
}));
};

const refreshList = useCallback(async () => {
const refreshList = async () => {
memoList.reset();
setState((state) => ({ ...state, nextPageToken: "" }));
fetchMoreMemos("");
}, [props.filter, props.pageSize]);
};

useEffect(() => {
refreshList();
Expand Down

0 comments on commit cb569c9

Please sign in to comment.