react-bootstrap-table icon indicating copy to clipboard operation
react-bootstrap-table copied to clipboard

Uncaught TypeError: Cannot read property 'Component' of undefined at Object.defineProperty.value

Open amshim opened this issue 9 years ago • 4 comments

I am getting the following typeError coming from the react-bootstrap-table.js file. I am trying to get column filtering to work (not columnFilter, but just filter).

<TableHeaderColumn dataField="id" filter={{ type: 'TextFilter' }} isKey hidden></TableHeaderColumn>

Screenshot of error

amshim avatar Jan 08 '17 07:01 amshim

@amshim, I can't reproduce this issue, could you please show me the whole example code? Thank you

AllenFang avatar Jan 08 '17 09:01 AllenFang

@AllenFang

This is the exact error: Screenshot Here


 render() {
    const tableOptions = {
      onRowClick: this.onRowSelect,
      sizePerPage: 20,  // which size per page you want to locate as default
      sizePerPageList: [ 20, 50, 100 ], // you can change the dropdown list for size per page
      paginationShowsTotal: this.renderShowsTotal // Accept bool or function
    };
    return(
      <BootstrapTable striped hover search
                      headerStyle={{ marginBottom: '-20px' }}
                      data={this.props.printTests}
                      options={tableOptions} 
                      pagination={true}>
        <TableHeaderColumn dataField="id" filter={{ type: 'TextFilter' }} isKey hidden>ID</TableHeaderColumn>
        <TableHeaderColumn dataField="name" filter={{ type: 'TextFilter' }}>Name</TableHeaderColumn>
      </BootstrapTable>
    );
  }

The above is the sample code. I am trying to use the filter option per column. I have the react-bootstrap-table.css file inside my app/assets/index.html. For some reason, the column search boxes do not appear when I run this locally, but shows up when I push it up to my server.

Regardless, the error happens in both cases still (locally and on my server).

amshim avatar Jan 31 '17 08:01 amshim

~~Actually, the uncaught error COULD be an unrelated issue to your library. I am still investigating.~~

edit: removing react-bootstrap-table.css from my index.html makes the error go away. Clicking on the red error message leads me here: http://i.imgur.com/E03cOlb.png

However, the main problem still stands, that the filter option does not show up when I run my code locally.

amshim avatar Jan 31 '17 08:01 amshim

@amshim, actually, I follow your code but still cant reproduce this error, BTW, you should add react-bootstrap-table.min.css and I thought the error is not related with css file. Anyway, I thought this error really not related with this library. I'll open this issue if there're the same issue for other people or I can reproduce this issue on my local.

BTW, according to your example, if it's a bug, it was supposed to be opened early.

AllenFang avatar Jan 31 '17 12:01 AllenFang