shadcn-admin icon indicating copy to clipboard operation
shadcn-admin copied to clipboard

[BUG]: Local state management for table

Open Kepron opened this issue 7 months ago • 0 comments

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.

https://github.com/satnaing/shadcn-admin/blob/69f5a713cb4f8511ae80d3e16e101d2b33246f73/src/features/tasks/components/tasks-table.tsx#L100-L103

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?

Kepron avatar Sep 03 '25 12:09 Kepron