mirror of
https://github.com/gosticks/react-bootstrap-table2.git
synced 2026-07-01 06:30:11 +00:00
fix wrong HOC for SortWrapper (#148)
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
import { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import { paginationElement } from '../table-factory';
|
||||
import { sortableElement } from '../table-factory';
|
||||
|
||||
class SortWrapper extends Component {
|
||||
constructor(props) {
|
||||
@@ -34,7 +34,7 @@ class SortWrapper extends Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
return paginationElement({
|
||||
return sortableElement({
|
||||
...this.props,
|
||||
ref: node => this.table = node,
|
||||
onSort: this.handleSort,
|
||||
|
||||
@@ -20,11 +20,13 @@ export const pureTable = props =>
|
||||
React.createElement(BootstrapTable, { ...props });
|
||||
|
||||
export const wrapWithPagination = (props) => {
|
||||
const { wrapper } = props.pagination;
|
||||
const PaginationBase = wrapper(pureTable);
|
||||
return React.createElement(PaginationBase, { ...props });
|
||||
if (props.pagination) {
|
||||
const { wrapper } = props.pagination;
|
||||
const PaginationBase = wrapper(pureTable);
|
||||
return React.createElement(PaginationBase, { ...props });
|
||||
}
|
||||
return pureTable(props);
|
||||
};
|
||||
export const paginationElement = props => pureTable(props);
|
||||
|
||||
export const sortableElement = props => wrapWithPagination(props);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user