csf icon indicating copy to clipboard operation
csf copied to clipboard

Only exports that are functions should be considered stories

Open mariusGundersen opened this issue 3 years ago • 1 comments

There is a way to have non-story exports in es6 modules, but it's a bit cumbersome. I'm wondering if it would be easier to say that only exports which are functions are stories, and to ignore other exports? There is probably a reason this isn't the case, but it's not clear from the documentation. It even says

With CSF, every named export in the file represents a story function by default.

so it seems like only functions can be stories. It wouldn't be too difficult then to ignore exports where typeof potentialStory !== 'function', right?

mariusGundersen avatar Sep 03 '20 14:09 mariusGundersen

We want to leave the door open for making stories that are only data objects.

shilman avatar Sep 04 '20 16:09 shilman