Fix data table storybook story to show mock data#53
Conversation
LC-177: Migrate LambdaCurry/forms to latest React Router and React version
…uter; adjust Storybook configurations accordingly
…er for improved alignment with labels
…zation and PR previews - Added `noNamespaceImport` option to `biome.json` for better TypeScript handling. - Enhanced README with detailed instructions for PR previews and GitHub environment setup. - Updated `yarn.lock` to reflect dependency changes, including `react-day-picker` and `remix-hook-form`. - Introduced new GitHub Actions workflow for automatic PR previews. - Added custom components documentation for form elements, ensuring type safety and flexibility. - Refactored checkbox and radio group components to support custom component injection.
…r integration - Upgraded from version 18 to 19 in and . - Replaced with in multiple story files to support React Router. - Adjusted import paths for components in CSS and story files for consistency. - Enhanced checkbox and radio group components with additional data attributes for better accessibility.
…tack types, improving code clarity and consistency. Clean up JSX formatting for better readability across data table files.
…omponents and cmdk package. Refactor form components for improved readability and consistency, including type imports for React. Enhance DataTableRouterForm with auto-submit functionality on filter changes.
…sed submitHandlers and update route path. Delete unused data table story files for improved project clarity.
… in data table components and enhance DataTableRouterForm with improved filtering and pagination features. Refactor data table components for better clarity and consistency, including removal of unused files.
…ns and improve clarity.
…rms into codegen-data-table-nuqs-zod-lc190
…lc190 Implement nuqs and zod filters for DataTableRouterForm
…ase commands, and adjust build outputs. Update dependencies in yarn.lock for improved functionality and performance.
…ts instead of forwardRefs. Update story examples for better clarity and consistency across checkbox, dropdown, radio group, switch, text field, and textarea components.
…neration and custom styling. Introduce FullWidthCardLabel for clickable labels and refactor stories to demonstrate various usage patterns. Update VSCode settings for Tailwind CSS class attributes.
…o the main input field instead of multiple textboxes. Update comments for clarity.
…andling. Introduce sleep helper for delays, ensuring robust interaction testing. Commented out dropdown menu play function for future implementation.
…ps from GitHub Actions workflow
…ld process in both root and docs apps.
…iddleware directly
…rm-v7 Update remix-hook-form to v7.0.0 for React Router 7 compatibility
…hook for URL state management
…r for data fetching
|
|
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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 issue with the data table storybook story not showing any example data from the mock loader after removing the nuqs library in PR #51.
Changes Made
Updated the React Router stub to provide default URL parameters when running in Storybook:
page=0&pageSize=10when window.location.search is not availableEnhanced the loader function in the data table story:
These changes ensure that the data table storybook story correctly shows the mock data from the loader, even after removing the nuqs library and replacing it with React Router's built-in features.
Root Cause
The issue was that the React Router stub in Storybook wasn't providing the necessary URL parameters for the loader function to work correctly. When nuqs was removed, the code started relying on React Router's useSearchParams hook, but the stub wasn't properly configured to provide the default parameters needed by the data table component.
Testing
The changes have been tested in Storybook, and the data table now correctly shows the mock data as expected.
💻 View my work • About Codegen