React-table: Infinity render with usePaginaton

Created on 28 Jul 2019  路  4Comments  路  Source: tannerlinsley/react-table

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",

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.

All 4 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

golan4ik picture golan4ik  路  18Comments

nikhilem picture nikhilem  路  27Comments

visarts picture visarts  路  36Comments

ggascoigne picture ggascoigne  路  18Comments

prathmeshphuke picture prathmeshphuke  路  33Comments