react-bootstrap-table / react-bootstrap-table2

Next Generation of react-bootstrap-table
https://react-bootstrap-table.github.io/react-bootstrap-table2/
MIT License
1.27k stars 431 forks source link

wrapperFactory is not a function #450

Closed ali-master closed 6 years ago

ali-master commented 6 years ago

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.

AllenFang commented 6 years ago

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

AllenFang commented 6 years ago

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

ali-master commented 6 years ago

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

AllenFang commented 6 years ago

@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

ali-master commented 6 years ago

Great job.

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

AllenFang commented 6 years ago

@ali-master Cooool 👍

ghost commented 6 years ago

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
ali-master commented 6 years ago

Would you share your written code about the table config?

ghost commented 6 years ago

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'), ) }); `
ghost commented 6 years ago

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

ghost commented 6 years ago

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

ali-master commented 6 years ago

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.

ali-master commented 6 years ago

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.

paulalcabasa commented 6 years ago

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

ali-master commented 6 years ago

@paulalcabasa Please prevent to duplicate reply