Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table component randomly fails to render provided items. #6399

Open
SerhiiArbonics opened this issue May 16, 2024 · 1 comment
Open

Table component randomly fails to render provided items. #6399

SerhiiArbonics opened this issue May 16, 2024 · 1 comment

Comments

@SerhiiArbonics
Copy link

SerhiiArbonics commented May 16, 2024

Provide a general summary of the issue here

I'm using Table component in my Remix js application. Table items are provided by the loader function.
Table sorting, search, pagination is handled with the URL query parameters.
When user interacting with the table sorting, pagination or search for some time, the table component randomly stop showing content and renders empty state fallback component instead.
I checked the items array, it contains data, but when I use React dev tools and check TableBody component, it shows that collection is empty, while props have items.

Screenshot 2024-05-16 at 23 36 06 Screenshot 2024-05-16 at 23 37 01

Here is my code

      <Table onSortChange={handleSorting} sortDescriptor={getSortDescriptor()}>
        <TableHeader columns={columns}>
          {(column) => (
            <Column isRowHeader={column.isRowHeader}>{column.name}</Column>
          )}
        </TableHeader>
        <TableBody items={tableRows} renderEmptyState={() => "no results"}>
          {(item) => (
            <Row aria-label="Table Row" columns={customerTableColumns}>
              {(column) => (
                <Cell aria-label="Table Cell">{item[column.id]}</Cell>
              )}
            </Row>
          )}
        </TableBody>
      </Table>

🤔 Expected Behavior?

Table should render items if provided.

😯 Current Behavior

Sometimes table does not render items.

💁 Possible Solution

Unfortunately I don't have solution.

🔦 Context

Items are dynamic, provided by the Remix loader with the help of useLoaderData hook.

🖥️ Steps to Reproduce

Unable to reproduce it in sandbox. Might be SSR related.

Version

1.1.1

What browsers are you seeing the problem on?

Chrome

If other, please specify.

Remix js

What operating system are you using?

Mac OS

🧢 Your Company/Team

Arbonics

🕷 Tracking Issue

No response

@snowystinger
Copy link
Member

snowystinger commented May 16, 2024

Thanks for the issue!

If you can't reproduce in a codesandbox, you could try stackblitz, they have a bit more flexibility for things like SSR. Or you can create a public git repo with an example project in it.

Unfortunately, I don't have any ideas off the top of my head. We'll need a reproduction to investigate further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants