-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Next.js: Fix useParams
support
#22946
Conversation
next/navigation#useParams
returns null
when using @storybook/nextjs
useParams
support
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Waiting for our NextJS expert @valentinpalkovic to take a look before merging. He'll be back from vacation next week.
@gitstart-storybook Thank you so much for your PR! The changes look amazing. Could you do me a favor and adjust the documentation after https://github.com/storybookjs/storybook/tree/next/code/frameworks/nextjs#useselectedlayoutsegment-and-useselectedlayoutsegments-hook as well, to describe how to set the data properly? |
Co-authored-by: phunguyenmurcul <51897872+phunguyenmurcul@users.noreply.github.com>
useParams
supportuseParams
support
Issue: #22077
What I did
GlobalLayoutRouterContext
intoAppRouterProvider
to passuseParams
validation in nextjsuseParams
How to test
useParams
usage doesn't throw any errors.useParams
mocking valueRef
GitStart Ticket