fix pagination click event

This commit is contained in:
Pig Fang 2020-03-27 16:38:07 +08:00
parent 231b9ee5bf
commit effba662a0

View File

@ -6,7 +6,7 @@ interface Props {
onClick?(): void
}
const PaginationItem: React.FC<Props> = props => {
const PaginationItem: React.FC<Props> = (props) => {
const classes = ['page-item']
if (props.active) {
classes.push('active')
@ -15,7 +15,8 @@ const PaginationItem: React.FC<Props> = props => {
classes.push('disabled')
}
const handleClick = () => {
const handleClick = (event: React.MouseEvent) => {
event.preventDefault()
if (!props.disabled && props.onClick) {
props.onClick()
}