Module format: use story field for name/parameters annotation

This commit is contained in:
Michael Shilman 2019-06-26 16:12:37 +08:00
parent 41e86d8f7c
commit ee199f6ab1

View File

@ -323,9 +323,9 @@ export default function start(render, { decorateStory } = {}) {
Object.keys(exports).forEach(key => {
if (isExportStory(key, meta)) {
const story = exports[key];
const { title = story.title || key, parameters } = story;
kind.add(title, story, parameters);
const storyFn = exports[key];
const { name, parameters } = storyFn.story || {};
kind.add(name || key, storyFn, parameters);
}
});