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

Patch for Issue 9294 #9698

Closed
wants to merge 1 commit into from
Closed

Patch for Issue 9294 #9698

wants to merge 1 commit into from

Conversation

brotsky
Copy link

@brotsky brotsky commented Jan 31, 2020

Patch was suggested here: https://github.com/storybookjs/storybook/issues/9294#issuecomment-580582681
Credit: @arlyon

Issue:

What I did

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.

@@ -176,7 +176,7 @@ export const applyHooks = (
const { hooks } = context;
hooks.prevMountedDecorators = hooks.mountedDecorators;
hooks.mountedDecorators = new Set([getStory, ...decorators]);
hooks.currentContext = context;
hooks.currentContext = Object.assign({}, context, { hooks: null });
Copy link
Member

@ndelangen ndelangen Feb 3, 2020

Choose a reason for hiding this comment

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

This would ensure the ref to hooks.currentContext is always new/different.

And it would always overload context.hooks with null

That doesn't seem right to me.

What about:

Suggested change
hooks.currentContext = Object.assign({}, context, { hooks: null });
hooks.currentContext = context || { hooks: null };

?

@stale
Copy link

stale bot commented Feb 24, 2020

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

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.

3 participants