Access filtered data in ReactTable

I have just found the answer by referencing this article

get refer of table like following:

<ReactTable
  ref={(r) => {
    this.selectTable = r;
  }}
  ...
/>

And in your function

const currentRecords = this.selectTable.getResolvedState().sortedData;

If you are using React 16.7-alpha+ with hooks you can do something like the following too.

import { useState, useRef } from 'react';

const [pageSize, setPageSize] = useState(20);
let reactTable = useRef(null);

<ReactTable
    ref={(r) => (reactTable = r)}
    onFilteredChange={() => {
      setPageSize(reactTable.getResolvedState().sortedData.length);
    }}
/>