React-bootstrap-table2: wrapperFactory is not a function

Created on 5 Aug 2018  路  15Comments  路  Source: react-bootstrap-table/react-bootstrap-table2

Hi,

Thank you for developing this library.
I have a problem with that.
When I use the paginationFactory function, that will return the following errors.
screen shot 2018-08-05 at 1 34 11 pm

react-bootstrap-table-next": 1.0.0
react-bootstrap-table2-overlay": 1.0.0
react-bootstrap-table2-paginator": 1.0.0

My config:
screen shot 2018-08-05 at 1 39 17 pm

Please help me.
Thank you in advance.

All 15 comments

@ali-master hello, seems like you use newest releases, what's the version of your React.js ?

BTW, there's not more container.js in 1.0.0, are u sure you upgrade successfully for react-bootstrap-table-next?

Hi @AllenFang,

Yes, I'm sure using the latest version.
screen shot 2018-08-06 at 12 03 04 pm

React version: 16.4.2

@ali-master yes i understand, but the error message show that react-bootstrap-table-next may stay in the legacy version. Could you please remove the node_modules and run install again? thanks

Great job.

That's helped me, thanks
The problem was fixed.

@ali-master Cooool 馃憤

Hello, I am getting the same error with the filterFactory function even though I removed " node_modules and run install again".

screen shot 2018-08-07 at 12 37 41

Any idea how I could fix that?

Thank you in advance
screen shot 2018-08-07 at 12 17 55

Would you share your written code about the table config?

Of course! You mean the Boostrap-table?

Here it is:

`
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import Routes from './routes';
//import App from './components/landingPage';
import {
graphql,
ApolloProvider,
createNetworkInterface
} from 'react-apollo';
import 'react-bootstrap-table-next/dist/react-bootstrap-table2.min.css';
import { ApolloClient } from 'apollo-client';
import { HttpLink } from 'apollo-link-http';
import { InMemoryCache } from 'apollo-cache-inmemory';
import gql from 'graphql-tag';
import BootstrapTable from 'react-bootstrap-table-next';
import filterFactory, { dateFilter } from 'react-bootstrap-table2-filter';

const httpLink = new HttpLink({
uri: "graphql#execute"
});

let tableQuery = gql{ allBookingHotelRooms{ id gettingBookingDate gettingHotel gettingRoomCategory gettingAvailabilityPrice gettingNRoomsAvailable } }

const cache = new InMemoryCache();

const client = new ApolloClient({
link: httpLink,
cache,
});

class App2 extends Component {

state = {
products: [],
columns: [{
dataField: 'gettingBookingDate',
text: 'Booking Date',
filter: dateFilter()
},
{ dataField: 'gettingHotel',
text: 'Hotel',
},
{
dataField: 'gettingRoomCategory',
text: 'Room Category'
}, {
dataField: 'gettingAvailabilityPrice',
text: 'Price',
},
{
dataField: 'gettingNRoomsAvailable',
text: 'Nbre # dispos'
}
]
}

render() {
let { data } = this.props
if (data.loading) {
return

Loading...

}

return (
  <div className="container" style={{ marginTop: 50 }}>
    <BootstrapTable
    striped
    hover
    keyField='id'
    data={ this.props.data.allBookingHotelRooms }
    columns={ this.state.columns }
    filter={ filterFactory() }
    />
  </div>
);

}
}

const TableInfoWithData = graphql(tableQuery, {options: { pollInterval: 20000 },
})(App2);

document.addEventListener('DOMContentLoaded', () => {
ReactDOM.render(
/>
, document.getElementById('example-app'),
)
});
`

everything is working fine until I had filter={ filterFactory() } to the <BootstrapTable /> component

Hey Ali did you see anything wrong with my code? Thank you for the help anyway

Hi @maxvia87,

apologies for the delay in replying.
It works for me.
screen shot 2018-08-09 at 10 29 26 pm

What's the version of your React.js?

BR.

If you can, please remove your node_module folder and try again with Yarn package manager instead of NPM because npm has many problems like always for installing packages without caching.

Having the same issue, removed node_modules folder and reinstall using NPM, didnt work. reinstall using YARN , still same issue.

@paulalcabasa Please prevent to duplicate reply

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kamarajuPrathi picture kamarajuPrathi  路  4Comments

harishkumarreddy12 picture harishkumarreddy12  路  3Comments

rsgoss picture rsgoss  路  4Comments

nskiro picture nskiro  路  4Comments

Randore picture Randore  路  3Comments