You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/03/29 03:15:36 UTC

[GitHub] [apisix-dashboard] SkyeYoung commented on a change in pull request #2370: feat: add page reload judgment

SkyeYoung commented on a change in pull request #2370:
URL: https://github.com/apache/apisix-dashboard/pull/2370#discussion_r837016920



##########
File path: web/src/hooks/usePagination.ts
##########
@@ -30,5 +33,14 @@ export default function usePagination() {
     history.replace(`${location.pathname}?page=${page}&pageSize=${pageSize}`);
   };
 
-  return { paginationConfig, savePageList };
+  const checkPageList = (ref: MutableRefObject<ActionType | undefined>) => {
+    const { current, pageSize, total } = ref.current!.pageInfo as PageInfo;

Review comment:
       ```suggestion
       const { current, pageSize, total } = ref.current?.pageInfo as PageInfo;
   ```
   
   `!.` will just remove `undefined` and `null` from the `current`'s type. Maybe `?.` is better?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org