File tree 2 files changed +3
-8
lines changed
2 files changed +3
-8
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " react-laravel-paginex" ,
3
- "version" : " 2.0.3 " ,
3
+ "version" : " 2.0.4 " ,
4
4
"description" : " Laravel Pagination with ReactJS (customizable)" ,
5
5
"main" : " dist/index.js" ,
6
6
"scripts" : {
Original file line number Diff line number Diff line change @@ -14,23 +14,19 @@ class Pagination extends Component {
14
14
}
15
15
16
16
componentDidMount ( ) {
17
- this . setState ( { options : this . props . options , paginationData : this . props . data } ) ;
18
17
this . getProps ( this . props ) ;
19
18
}
20
19
21
20
componentWillReceiveProps ( props , nextContext ) {
22
- this . setState ( { options : props . options , paginationData : props . data } ) ;
23
21
this . getProps ( props ) ;
24
22
}
25
23
26
24
// Transform props
27
25
getProps = ( props ) => {
28
26
let defaultProps = Pagination . defaultProps . options ;
29
- let options = this . state . options ;
27
+ let options = this . props . options ;
30
28
Object . keys ( defaultProps ) . forEach ( function ( key ) {
31
- if ( ! options [ key ] ) {
32
- options [ key ] = props [ key ] ? props [ key ] : defaultProps [ key ] ;
33
- }
29
+ options [ key ] = props [ key ] ? props [ key ] : props [ 'options' ] [ key ] ? props [ 'options' ] [ key ] : defaultProps [ key ] ;
34
30
} ) ;
35
31
this . setState ( { options : options , paginationData : props . data } ) ;
36
32
} ;
@@ -47,7 +43,6 @@ class Pagination extends Component {
47
43
parameters = this . props . requestParams ;
48
44
}
49
45
parameters . page = page ;
50
- console . log ( 'ddd' ) ;
51
46
this . props . changePage ( parameters ) ;
52
47
} ;
53
48
You can’t perform that action at this time.
0 commit comments