csf
csf copied to clipboard
Dynamic stories
What’s the best approach for programmatically generated stories?
For example, something like this
stories.forEach(story => {
exports[story.name] = {
// story values here
}
})
I can’t seem to get a solution with module.exports
, export default
, export const
, exports
etc.
Note: This pattern is supported by storiesOf
.
also interested in this! if you have a component with a couple of dimensions, creating stories manually is quite tedious
@rpander93 We don't really support that in CSF3. I normally use controls for this problem if my component depends on a couple of different dimensions. So that you can easily switch within the controls to any dimension you need.
right, i guess that's also a way to solve it. thanks!