Fix data table storybook story to show mock data#52
Fix data table storybook story to show mock data#52jaruesink merged 1 commit intocodegen-replace-nuqs-with-react-routerfrom
Conversation
|
|
|
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.
|
176e787
into
codegen-replace-nuqs-with-react-router
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.
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