Fix useFilterSync implementation in data-table-bazza-filters story#61
Conversation
1. Fix server-side filtering to properly use filters from URL params 2. Ensure filters persist on page refresh by using URL as source of truth 3. Fix pagination to allow navigation between pages 4. Update faceted counts to reflect filtered data instead of original data
|
|
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Join our Discord community for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
📝 Storybook Preview: View Storybook This preview will be updated automatically when you push new changes to this PR.
|
This PR fixes the error in the bazza filter story that was causing the "undefined is not an object (evaluating 'n.length')" error.
The issue was that the PR changed the implementation of
useFilterSyncin the story file to return an object withfiltersandhandleFiltersChangeproperties, but the actual implementation in the codebase returns an array withfiltersandsetFilters.Changes made:
useFilterSync()to use array destructuringconst [filters, setFilters] = useFilterSync()instead of object destructuringhandleFiltersChangeto usesetFiltersin the table configurationThis should resolve the error and allow the storybook tests to run correctly.
💻 View my work • About Codegen