Skip to content
This repository has been archived by the owner on Jan 5, 2023. It is now read-only.

Doesn't apply the correct props when multiple components of the same type are on the same page #71

Open
Reffyy opened this issue Jan 28, 2020 · 1 comment

Comments

@Reffyy
Copy link

Reffyy commented Jan 28, 2020

Code:

Button.stories.tsx

export const All = () => (
    <div>
        <Button className="primary" text="Primary"/>
        <Button className="secondary" text="Secondary"/>
    </div>
)

All.story = {
  decorators: [withSmartKnobs(), withKnobs]
}

Expected Result:

Screen Shot 2020-01-28 at 15 09 14

Actual Result:

Screen Shot 2020-01-28 at 15 09 32

This issue also applies when using the Docs addon (as it's a single page), meaning that all of the components within the page have the props of the first created component.

From what I can see, the values for the first component are stored against prop names when the page is navigated to and then the same values are used for every value for each component following. Could we try assigning the values to a unique property of each element instead?

Thanks!

@dantman
Copy link

dantman commented Feb 9, 2020

Same problem. As soon as I tricked smart-knobs into supporting my component it ruined my docs page. I'd be happy at least with it being disable for docs page examples where the Knobs panel is not available as a start.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants