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.

Props first tab renamed to `Story` when using args

See original GitHub issue

Describe 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 Screenshot 2020-09-02 at 16 12 14

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:closed
  • Created 3 years ago
  • Reactions:8
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
hadnetcommented, Nov 21, 2020

I confirm this even using last version 6.1. I’m using MDX as a workaround…

0reactions
shilmancommented, Feb 20, 2021

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!

npx sb upgrade --prerelease

Closing this issue. Please re-open if you think there’s still more to do.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Args - Storybook - JS.ORG
“Args” are Storybook's mechanism for defining those arguments in a single JavaScript object. Args can be used to dynamically change props, slots, styles,...
Read more >
@storybook/client-api - npm
Start using @storybook/client-api in your project by running `npm i ... The story parameters is a static, serializable object of data that provides...
Read more >
props.conf - Splunk Documentation
Configure Splunk Enterprise to use proxies. Use a forward Proxy Server for ... Start Splunk Enterprise and perform initial tasks ... Rename source...
Read more >
React with TypeScript Cheatsheet - Bits and Pieces
Now that you know how to check the props type, here's a list of common types that you may want to use in...
Read more >
Intercept/handle browser's back button in React-router?
As of react-router@5.0.0 you can't import browserHistory as illustrated in this response. It appears that history is included in the props ...
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