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

api: return defaultValue in useParameter if story is not prepared #18887

Merged
merged 1 commit into from
Aug 11, 2022

Conversation

yannbf
Copy link
Member

@yannbf yannbf commented Aug 8, 2022

What I did

Given the changes in Storybook 7.0, when calling useParameter and a story existed but had story.prepared === false, the code was returning an empty object rather than just null, which is a breaking change and broke addons that relied on the value being undefined.

How to test

  • Is this testable with Jest or Chromatic screenshots?
  • Does this need a new example in the kitchen sink apps?
  • Does this need an update to the documentation?

If your answer is yes to any of these, please make sure to include it in your PR.

it was returning an empty object before, which is a breaking change.
Copy link
Member

@tmeasday tmeasday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@yannbf yannbf merged commit cd97f8c into next Aug 11, 2022
@yannbf yannbf deleted the yann/sb-647-getparameters-returns-empty-object-if branch August 11, 2022 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants