-
Notifications
You must be signed in to change notification settings - Fork 2k
Description
Package
@carbon/react
Browser
Chrome
Package version
1.92.0
React version
19
Description
Refs #18344
when opening the stackblitz preview from storybook .mdx files, preview components don't work.

Similar for layout, missing in the import statement

I think this is happening because stackblitzPrefillConfig compares the list of exports from the top-level entrypoint to what's in the story. Stories use IconIndicator
, but the top level export we expose to consumers is preview__IconIndicator
.
I think it's just this filter function that needs updated to look at both componentName
and "preview__" + componentName
and then use the preview one in the generated stackblitz output.
carbon/packages/react/previewer/codePreviewer.tsx
Lines 58 to 63 in f81e5e9
return componentNames.filter((componentName) => { | |
// Grab the component and add the "<" resulting in"`<ComponentName` | |
const regex = new RegExp(`<${componentName}\\b`, 'g'); | |
// Check if the component exists in the `storyCode` | |
return regex.test(storyCode); | |
}); |
Reproduction/example
react.carbondesignsystem.com
Steps to reproduce
Go to the storybook, click on an overview page for a preview component, try to open in stackblitz.
Suggested Severity
Severity 3 = User can complete task, and/or has a workaround within the user experience of a given component.
Application/PAL
n/a
Code of Conduct
- I agree to follow this project's Code of Conduct
- I checked the current issues for duplicate problems
Metadata
Metadata
Assignees
Labels
Type
Projects
Status