perf: bill

This commit is contained in:
archer
2023-07-13 22:53:44 +08:00
parent 726de0396b
commit f3715731c4
67 changed files with 915 additions and 1254 deletions

View File

@@ -1,4 +1,4 @@
import { useRef, useState, useCallback, useLayoutEffect, useMemo, useEffect } from 'react';
import { useRef, useState, useCallback, useMemo, useEffect } from 'react';
import type { PagingData } from '../types/index';
import { IconButton, Flex, Box, Input } from '@chakra-ui/react';
import { ArrowBackIcon, ArrowForwardIcon } from '@chakra-ui/icons';
@@ -144,7 +144,7 @@ export const usePagination = <T = any,>({
[data.length, isLoading, mutate, pageNum, total]
);
useLayoutEffect(() => {
useEffect(() => {
if (!elementRef.current || type !== 'scroll') return;
const scrolling = throttle((e: Event) => {