You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
** Disclaimer** This information might be inaccurate, due to it being generated automatically
This is a bug in how story composition handles default args and arg mappings. To fix: 1. Modify processCSFFile in code/lib/csf-tools/src/CsfFile.ts to include default args and argTypes when processing composed stories 2. Update story composition logic in code/lib/preview-api/src/modules/store/csf/composeStories.ts to: - Merge default args from parent story - Apply arg mappings from parent story's argTypes - Preserve the mapping chain when composing stories Example implementation: ts // In composeStories.ts const composeStory = (story, meta, globalConfig) => { const parentArgs = meta.args || {}; const parentArgTypes = meta.argTypes || {}; return { ...story, args: { ...parentArgs, ...story.args, }, argTypes: { ...parentArgTypes, ...story.argTypes } }; };
About Greptile
This response provides a starting point for your research, not a precise solution.
Help us improve! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
Describe the bug
Say I have a story like so, using default
args
andmapping
:I want to reuse the
Primary
story in another so following the docs I do something like so:The default arg value for
children
is not present.If the Buttons story I'm trying to compose does define the
children
argument like so:When I try to compose it the value of
children
is the string"basic"
not the mapped value.Reproduction link
https://stackblitz.com/edit/github-glatzagq
Reproduction steps
System
Additional context
No response
The text was updated successfully, but these errors were encountered: