@@ -2,6 +2,7 @@ import React from 'react';
2
2
import classNames from 'classnames' ;
3
3
import BootstrapMixin from './BootstrapMixin' ;
4
4
import createSelectedEvent from './utils/createSelectedEvent' ;
5
+ import SafeAnchor from './SafeAnchor' ;
5
6
6
7
const PaginationButton = React . createClass ( {
7
8
mixins : [ BootstrapMixin ] ,
@@ -25,24 +26,29 @@ const PaginationButton = React.createClass({
25
26
} ,
26
27
27
28
handleClick ( event ) {
28
- // This would go away once SafeAnchor is available
29
- event . preventDefault ( ) ;
30
-
31
29
if ( this . props . onSelect ) {
32
30
let selectedEvent = createSelectedEvent ( this . props . eventKey ) ;
33
31
this . props . onSelect ( event , selectedEvent ) ;
34
32
}
35
33
} ,
36
34
37
35
render ( ) {
38
- let classes = this . getBsClassSet ( ) ;
36
+ let classes = {
37
+ active : this . props . active ,
38
+ disabled : this . props . disabled ,
39
+ ...this . getBsClassSet ( )
40
+ } ;
39
41
40
- classes . active = this . props . active ;
41
- classes . disabled = this . props . disabled ;
42
+ let {
43
+ className,
44
+ ...anchorProps // eslint-disable-line object-shorthand
45
+ } = this . props ;
42
46
43
47
return (
44
- < li className = { classNames ( this . props . className , classes ) } >
45
- < a href = '#' onClick = { this . handleClick } > { this . props . children } </ a >
48
+ < li className = { classNames ( className , classes ) } >
49
+ < SafeAnchor
50
+ { ...anchorProps }
51
+ onClick = { this . handleClick } />
46
52
</ li >
47
53
) ;
48
54
}
0 commit comments