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

Button knob (again) rerenders component, but only once #8825

Closed
goatfryed opened this issue Nov 13, 2019 · 1 comment
Closed

Button knob (again) rerenders component, but only once #8825

goatfryed opened this issue Nov 13, 2019 · 1 comment

Comments

@goatfryed
Copy link

Hey guys,
Version: 5.2.6
I'm having some issues with a button knob, but I don't really know to which open or closed issue i should append it - or just make a new one.
Related issues:
#6675
#1736 (comment)
#8614

I tried to implement a refresh knob decorator similar to #1736 (comment)

export default {
    decorators: [
        withKnobs,
        Story => {
            const [key, refresh] = useReducer(i => ++i, 0);
            button("Refresh", refresh /** or forceRerender or just () => {} **/);
            console.log("render");
            return <Story key={key} />
        },
    ],
}

The first click on the knob forces two rerenders of the component.
#6675 addressed rerenders on html stories on button knob click, but should have been resolved in 5.1
Every further click on the knob doesn't cause any reaction.

#8614 takes care of knobs fireing only once, but i'm not sure whether the story reload is related to it or got reintroduced on another note.

@goatfryed
Copy link
Author

Okay, after some more experimenting, I think I'll wait for #8614 being resolved first. I assume, the page reload is in most part related to the knobs fireing or not fireing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants