Skip to content

[BUG]: Local state management for table #218

@Kepron

Description

@Kepron

Describe the bug
Hello. I am using this design in my Next.js project. While integrating the table system, I ran into an issue and had to use local state management for the filter system. However, I couldn’t find the part of the code that was set up for local state management in the section below.

const pageCount = table.getPageCount()
useEffect(() => {
ensurePageInRange(pageCount)
}, [pageCount, ensurePageInRange])

I’m asking because when I render the table I get the following error:

Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously tries to update the component. Move this work to useEffect instead.

app\(protected)\dashboard\blogs\page.tsx (15:9) @ Home


  13 |       <Header title="Bloglar" description="Tüm bloglarınızın listelendiği sayfa." />
  14 |       <Main>
> 15 |         <Blogs />
     |         ^
  16 |       </Main>
  17 |     </>
  18 |   );

To fix the error, I need to add autoResetPageIndex: false to the useReactTable object, but then filtering stops working correctly.

What should I do about this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions