2

I'm trying to use react-perfect-scrollbar on react-table but it doesn't work, it does on a custom table.

<PerfectScrollbar>
        <Table className='table'>
          <thead className='table-head'><tr>{head}</tr></thead>
          <tbody className='DashboardCard-table-body'>{body}</tbody>
        </Table>
      </PerfectScrollbar>

I tried this:

<PerfectScrollbar>
    <ReactTable data={data} columns={columns} />    
</PerfectScrollbar>

It should show the new scrollbar but it doesn't.. haven't found information anywhere.

1 Answers1

2

Have you tried setting a height on the PerfectScrollbar JSX element? I had a similar issue that I solved with this:

<PerfectScrollbar style={{ height: "100vh" }}>
    ...Your content...
</PerfectScrollbar>

You might need to use a different value for height, but apparently the scrollbar needs a height value.

lauchness
  • 339
  • 3
  • 6