Props first tab renamed to `Story` when using args
See original GitHub issueDescribe the bug
When using args
in a CSF story with subcomponents, the main props table tab is renamed to Story
instead of using the main component name.
To Reproduce Setup a standard CSF story (no MDX)
// Tabs.stories.tsx
import React, { useState } from "react"
import { Story, Meta } from "@storybook/react/types-6-0"
import Tabs, { TabsPropsType } from "./"
export default {
title: "Tabs",
component: Tabs,
subcomponents: { "Tabs.Tab": Tabs.Tab },
} as Meta
export const Basic: Story<TabsPropsType> = (args) => {
return (
<Tabs myProp={args.myProp}>
<Tabs.Tab label="hello">Hello world!</Tabs.Tab>
<Tabs.Tab label="hello2">Hello world 2!</Tabs.Tab>
<Tabs.Tab label="hello3">Hello world 3!</Tabs.Tab>
</Tabs>
)
}
When I remove the args
usage in the story, the tab is back to the right name, Tabs
here.
Expected behavior Have the first tab named with the component name
Screenshots
System: System: OS: macOS 10.15.4 CPU: (12) x64 Intel® Core™ i7-8750H CPU @ 2.20GHz Binaries: Node: 12.5.0 - ~/.nodenv/versions/12.5.0/bin/node Yarn: 1.22.0 - /usr/local/bin/yarn npm: 6.9.0 - ~/.nodenv/versions/12.5.0/bin/npm Browsers: Chrome: 85.0.4183.83 Safari: 13.1 npmPackages: @storybook/addon-essentials: 6.0.21 => 6.0.21 @storybook/addon-knobs: 6.0.21 => 6.0.21 @storybook/addons: 6.0.21 => 6.0.21 @storybook/react: 6.0.21 => 6.0.21
Issue Analytics
- State:
- Created 3 years ago
- Reactions:8
- Comments:7 (2 by maintainers)
I confirm this even using last version 6.1. I’m using MDX as a workaround…
Yippee!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.2.0-alpha.31 containing PR #13845 that references this issue. Upgrade today to the
@next
NPM tag to try it out!Closing this issue. Please re-open if you think there’s still more to do.