React-bootstrap-table2: createContext error with pagination

Created on 4 Nov 2018  路  2Comments  路  Source: react-bootstrap-table/react-bootstrap-table2

Hello. I am trying to add Pagination to my table, but I am getting this error:

TypeError: props.pagination.createContext is not a function

Here's my render:

return (
      <div>
        <ToolkitProvider
          keyField="id"
          data={this.state.data}
          columns={columns}
          search
        >
          {
            props => (
              <div>
                <SearchBar {...props.searchProps}
                  placeholder="Search"
                />
                <hr />
                <BootstrapTable { ...props.baseProps } pagination={ paginationOptions } />
                <br />
              </div>
            )
          }
        </ToolkitProvider>
      </div>
    )

It doesn't seem to matter what options I provide, I always get the error. I tried using it outside fo the ToolkitProvider too. Same error.

I am using react 16.6.0
react-bootstrap-table-next 1.4.0
react-bootstrap-table2-paginator 1.0.3
react-bootstrap-table2-toolkit 1.1.1

Thanks!

Most helpful comment

I think you did wrong on pagination prop, please check following:

import paginationFactory from 'react-bootstrap-table2-paginator';

<BootstrapTable keyField='id' data={ products } columns={ columns } pagination={ paginationFactory() } />

All 2 comments

I think you did wrong on pagination prop, please check following:

import paginationFactory from 'react-bootstrap-table2-paginator';

<BootstrapTable keyField='id' data={ products } columns={ columns } pagination={ paginationFactory() } />

Issue happen with me after upgrade react-bootstrap-table-next from 0.1.15 to 3.0.0

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eylonronen picture eylonronen  路  3Comments

rsgoss picture rsgoss  路  4Comments

kamarajuPrathi picture kamarajuPrathi  路  4Comments

cnav007 picture cnav007  路  4Comments

ethannkschneider picture ethannkschneider  路  3Comments