Single Story Hoisting isn't working
See original GitHub issueDescribe the bug Single story hoisting isn’t working
Expected behavior I expect the single story to be hoisted as described in the documentation
Screenshots

Code snippets
import { SimpleButton as SimpleButtonComponent } from './SimpleButton';
export default {
title: 'Example/SimpleButton',
component: SimpleButtonComponent,
argTypes: {
// backgroundColor: { control: 'color' },
onClick: {},
},
};
const Template = (args) => ({
// Components used in your story `template` are defined in the `components` object
components: { SimpleButtonComponent },
// The story's `args` need to be mapped into the template through the `setup()` method
setup() {
return { args };
},
// And then the `args` are bound to your component with `v-bind="args"`
template: '<simple-button v-bind="args" />',
});
export const SimpleButton = Template.bind({});
SimpleButton.args = {
primary: true,
label: 'Button',
};
System Environment Info:
System: OS: macOS 10.15.7 CPU: (12) x64 Intel® Core™ i9-8950HK CPU @ 2.90GHz Binaries: Node: 12.13.1 - ~/.nvm/versions/node/v12.13.1/bin/node Yarn: 1.22.10 - ~/.nvm/versions/node/v12.13.1/bin/yarn npm: 6.12.1 - ~/.nvm/versions/node/v12.13.1/bin/npm Browsers: Chrome: 89.0.4389.90 Firefox: 69.0.3 Safari: 14.0.3 npmPackages: @storybook/addon-actions: ^6.2.0-rc.7 => 6.2.0-rc.9 @storybook/addon-essentials: ^6.2.0-rc.7 => 6.2.0-rc.9 @storybook/vue3: ^6.2.0-rc.7 => 6.2.0-rc.9
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Naming components and hierarchy - Storybook - JS.ORG
We recommend naming components according to the file hierarchy. Single story hoisting. Stories which have no siblings (i.e. the component has only one...
Read more >1926.1431 - Hoisting personnel.
Personnel hoisting operations must not resume until the device is again working properly. Alternative measures are not permitted. (See § 1926.1417 for tag-out ......
Read more >Hoisting. A little background story: | by Sam Bouguerra
Hoisting works with variable declarations using var but it doesn't work when the variables were declared with let or const. Function declarations are...
Read more >How JavaScript hoisting actually works - Code Gino
Unfortunately, no hoisting JavaScript exists, as in the magical movement of declarations to the top. The word hoist does not even exist in...
Read more >Hoisting - MDN Web Docs Glossary: Definitions of ... - Mozilla
Hoisting is not a term normatively defined in the ECMAScript specification. The spec does define a group of declarations as ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Your names don’t match. Story exports are “title cased” to get the name, in this case
Simple Button. Your component name (fromtitle) isSimpleButton. Note the missing space.Try
title: 'Example/Simple Button'Or if you don’t want the space, try
SimpleButton.name = "SimpleButton"Admittedly this is confusing. I wonder if we should consider the raw export name as well.
At very least we can update the docs with an example that reflects this scenario.
That was indeed the issue. Thanks!