Replies: 1 comment
-
|
So this will not work: import * as icons from '/assets/icons'A public/static file should be referenced by URL instead, for example: <img src="/assets/icons/my-icon.svg" alt="My icon" />If you need to iterate over all icons in MDX/React, move the icons into source code, for example const icons = import.meta.glob('../assets/icons/*.svg', {
eager: true,
query: '?url',
import: 'default',
})Or map the directory explicitly with Storybook: staticDirs: [{ from: '../public/assets/icons', to: '/assets/icons' }]and still reference them as URLs like In short: use |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
I have a React project with custom icons which I want to display in storybook as
Iconography.mdxbut when i useit returns
Which makes sense but when i try
it still returns
Does anyone have a solution for this?
Additional information
main.tsCreate a reproduction
No response
Beta Was this translation helpful? Give feedback.
All reactions