Hi, when i use usePaginaton i got infinity render on my func component
My test component:
import React from 'react';
import { useTable, useColumns, useRows, usePagination } from 'react-table';
export default function Table({ data, columns }) {
const instance = useTable(
{
data,
columns,
},
useColumns,
useRows,
usePagination
);
console.log('render', instance);
return <div />;
Place where i am use component:
const columns = [
{
Header: '#',
accessor: 'RANK',
},
];
const data = [
{
RANK: 1,
},
{
RANK: 2,
},
]
<Table
columns={columns}
data={data}
/>
What i get - infinity render every 1ms
https://gyazo.com/18d8e2662f1cd79ebfccb7e02d236bd0
Can someone help me? What's it may be?
"react-table": "^7.0.0-alpha.12",
"react": "^16.8.6",
I made it (basic example)
https://codesandbox.io/s/react-table-v7-sandbox-z6cvl
just uncomment console.log and watch console.panel -
care - browser will freeze after couple seconds becouse he will run out of memory
I'm having the same problem.
I'll be writing examples and tests for usePagination in the next few days. I'll likely uncover the bug then. Stay tuned.
Just tested with the latest alpha and this looks to be fixed on my end.
Most helpful comment
I'll be writing examples and tests for usePagination in the next few days. I'll likely uncover the bug then. Stay tuned.