Reuse library stories (from node_modules) across multiple applications #21841
CandyGreen
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm wondering if there is a way to solve this problem right now.
Let's imagine I have a component library called
shared
and 2 apps:app-1
andapp-2
. I plan to use components fromshared
repo across both applications, but I want to setup a different styling and props (e.g. I want to set a different logo inHeader
component) for each application.What can I do now: I can create stories for all my components in
shared
repo and bundle them. Insideapp-1
(orapp-2
) I can search for these stories like this (let's assume I can do this):I can set my application styles like this:
Okay, everything is fine so far. But how can I pass different props to my components without recreating a whole file with stories?
What if I have a file with lot of stories? Something like this:
Is this the only way I can reuse stories from
shared
, but modify theirargs
,parameters
,decorators
, etc.?Even If this approach works, it's quite inconvenient, besides the fact that I have to update this file in each application everytime I added a new story to
shared
repo:It would be much better if it could be possible to do something like this (I don't know how Storybook works internally, so I just give an example):
I don't know, maybe I'm the only person who encountered this kind of a problem, but I personally had 3 huge production projects built this way and "story copy-paste" doesn't feel good at all, when you have 10+ applications, which use the same component library 😵
I hope that this problem could be somehow resolved. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions