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

Next.js: Fix useParams support #22946

Merged
merged 4 commits into from Jun 19, 2023
Merged

Next.js: Fix useParams support #22946

merged 4 commits into from Jun 19, 2023

Conversation

gitstart-storybook
Copy link
Collaborator

Issue: #22077

What I did

  • Add GlobalLayoutRouterContext into AppRouterProvider to pass useParams validation in nextjs
  • Add story for mocking useParams

How to test

Ref

GitStart Ticket

@gitstart-storybook gitstart-storybook removed their assignment Jun 14, 2023
@shilman shilman changed the title Nextjs: next/navigation#useParams returns null when using @storybook/nextjs NextJS: Fix useParams support Jun 14, 2023
@shilman shilman added the patch:yes Bugfix & documentation PR that need to be picked to main branch label Jun 14, 2023
Copy link
Member

@shilman shilman left a 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.

@valentinpalkovic valentinpalkovic added the ci:daily Run the CI jobs that normally run in the daily job. label Jun 19, 2023
@valentinpalkovic
Copy link
Contributor

@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>
@valentinpalkovic valentinpalkovic merged commit b2fb6c9 into next Jun 19, 2023
99 checks passed
@valentinpalkovic valentinpalkovic deleted the fix/next-useParams-null branch June 19, 2023 18:47
@shilman shilman removed the patch:yes Bugfix & documentation PR that need to be picked to main branch label Jun 22, 2023
@shilman shilman added the patch:yes Bugfix & documentation PR that need to be picked to main branch label Jul 4, 2023
This was referenced Jul 4, 2023
@valentinpalkovic valentinpalkovic changed the title NextJS: Fix useParams support Next.js: Fix useParams support Jul 12, 2023
@valentinpalkovic valentinpalkovic added the patch:done Patch/release PRs already cherry-picked to main/release branch label Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug ci:daily Run the CI jobs that normally run in the daily job. nextjs patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: next/navigation#useParams returns null when using @storybook/nextjs
3 participants