question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

storybook/preact: clears out and rerenders story on each knob change

See original GitHub issue

Is your feature request related to a problem? Please describe. For some components it’s important to test changes in reaction to knob changes and not just rendering from the “clean slate”. For instance, a Preact component’s reaction to a prop change or a context change could cause performance problems which would otherwise be invisible if the component is rerendered from scratch. @storybook/react does not have this problem. But @storybook/preact forces the complete rerender. See this code.

Describe the solution you’d like Ideally, the normal Preact rendering would be used when knobs change w/o first clearing and unmounting of the component first.

Are you able to assist bring the feature to reality? May be. It looks like the change would otherwise be very simple.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
dvoytenkocommented, Sep 30, 2020

Tried it. Seems to work as expected now. Thanks a lot!

0reactions
shilmancommented, Sep 30, 2020

@dvoytenko thank you! great job fixing it! 🙏

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why Storybook's array knob isn't updating when changing the ...
When I see it in console, it does changes the array, but doesn't rerenders it. All other knobs work. I'm using a conditional...
Read more >
Next-level component showcasing with Storybook controls
Learn about controls, a new Storybook addon that lets you dynamically interact with your React components for demo and testing purposes.
Read more >
Storybook Addon Knobs (deprecated)
Button knobs cause the story to re-render after the handler fires. You can prevent this by having the handler return false . withKnobs...
Read more >
Storybook: background change on prop change
I changed the button.jsx file in my newly created react / storybook project . I changed backgroundColor prop to colorTheme and the code...
Read more >
A Dive into React Storybook - OpenReplay Blog
Finally, we need to tell Storybook what our stories are, as we had primary and secondary stories in our button category. To implement...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found