File tree Expand file tree Collapse file tree 2 files changed +7
-16
lines changed Expand file tree Collapse file tree 2 files changed +7
-16
lines changed Original file line number Diff line number Diff line change 4545 },
4646 "dependencies" : {
4747 "@babel/runtime" : " ^7.10.1" ,
48- "classnames" : " ^2.2.1"
48+ "classnames" : " ^2.2.1" ,
49+ "rc-util" : " ^5.32.2"
4950 },
5051 "devDependencies" : {
5152 "@types/classnames" : " ^2.2.9" ,
Original file line number Diff line number Diff line change 1- /* eslint react/prop-types: 0 */
21import classNames from 'classnames' ;
2+ import pickAttrs from 'rc-util/lib/pickAttrs' ;
33import React , { cloneElement , isValidElement } from 'react' ;
44import KEYCODE from './KeyCode' ;
55import LOCALE from './locale/zh_CN' ;
@@ -486,20 +486,10 @@ class Pagination extends React.Component<PaginationProps, PaginationState> {
486486 const prevPage = current - 1 > 0 ? current - 1 : 0 ;
487487 const nextPage = current + 1 < allPages ? current + 1 : allPages ;
488488
489- const dataOrAriaAttributeProps = Object . keys ( this . props ) . reduce (
490- ( prev , key ) => {
491- if (
492- key . substr ( 0 , 5 ) === 'data-' ||
493- key . substr ( 0 , 5 ) === 'aria-' ||
494- key === 'role'
495- ) {
496- // eslint-disable-next-line no-param-reassign
497- prev [ key ] = this . props [ key ] ;
498- }
499- return prev ;
500- } ,
501- { } ,
502- ) ;
489+ const dataOrAriaAttributeProps = pickAttrs ( this . props , {
490+ aria : true ,
491+ data : true ,
492+ } ) ;
503493
504494 const totalText = showTotal && (
505495 < li className = { `${ prefixCls } -total-text` } >
You can’t perform that action at this time.
0 commit comments