close
The Wayback Machine - https://web.archive.org/web/20220518161646/https://github.com/storybookjs/storybook/pull/12221
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

Preact: Keep the story state between rerenders #12221

Merged
merged 2 commits into from Sep 17, 2020

Conversation

dvoytenko
Copy link
Contributor

@dvoytenko dvoytenko commented Aug 24, 2020

Issue: #12177

What I did

With these changes, a Preact story will keep its state in between the rerenders, e.g. due to knob/control change. This will make Preact function similar to React.

How to test

  • Is this testable with Jest or Chromatic screenshots?

TODO

  • Does this need a new example in the kitchen sink apps?

TODO

  • Does this need an update to the documentation?

No: the forceRender is a normal Storybook mode and thus no new functionality has been enabled in this PR.

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

@shilman shilman changed the title Preact: keep the story state between rerenders Preact: Keep the story state between rerenders Aug 24, 2020
@tmeasday
Copy link
Member

@tmeasday tmeasday commented Aug 25, 2020

Perhaps @BartWaardenburg can speak to the original change in dfce65d#diff-1c5b1f58ac17d3362f80cffd129bf688R23

@BartWaardenburg
Copy link
Contributor

@BartWaardenburg BartWaardenburg commented Aug 25, 2020

Perhaps @BartWaardenburg can speak to the original change in dfce65d#diff-1c5b1f58ac17d3362f80cffd129bf688R23

Sorry, I can't remember wat was the reason for the change. 🤷

@developit
Copy link

@developit developit commented Sep 16, 2020

Hi all! The original fix from @BartWaardenburg was for Preact 8. Preact 10 was a rewrite and there is no longer any reason to do the clearing between renders - if anything, clearing between renders is more likely to produce strange results than not doing so.

@dvoytenko
Copy link
Contributor Author

@dvoytenko dvoytenko commented Sep 16, 2020

Ok. Sounds like there's a consensus that this change is a good idea. How do we proceed to get it merged?

@tmeasday
Copy link
Member

@tmeasday tmeasday commented Sep 17, 2020

I'm happy to merge it, not sure what happened to the CI build though, let me see..

@tmeasday tmeasday merged commit 22dabf7 into storybookjs:next Sep 17, 2020
34 of 36 checks passed
@dvoytenko
Copy link
Contributor Author

@dvoytenko dvoytenko commented Sep 17, 2020

Thanks!

@dvoytenko dvoytenko deleted the preact/force-render-support branch Sep 17, 2020
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.

None yet

5 participants