From 7ecfbb596986971769ebfb6b157d45ab0597e2df Mon Sep 17 00:00:00 2001 From: tanghui Date: Fri, 8 Dec 2023 19:59:56 +0800 Subject: [PATCH] fix: remove Array.prototype.at calls --- src/Pagination.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Pagination.tsx b/src/Pagination.tsx index 80d3eafe..fe3c5180 100644 --- a/src/Pagination.tsx +++ b/src/Pagination.tsx @@ -480,10 +480,11 @@ const Pagination: React.FC = (props) => { } if (allPages - current >= pageBufferSize * 2 && current !== allPages - 2) { - pagerList[pagerList.length - 1] = React.cloneElement(pagerList.at(-1), { + const lastOne = pagerList[pagerList.length - 1]; + pagerList[pagerList.length - 1] = React.cloneElement(lastOne, { className: classNames( `${prefixCls}-item-before-jump-next`, - pagerList.at(-1).props.className, + lastOne.props.className, ), });