React Storybook SVG Failed to execute 'createElement' on 'Document'

后端 未结 3 2009
抹茶落季
抹茶落季 2021-01-12 02:05

I\'m trying to add Storybook to an existing React app but getting errors with imported svg files. The svg is imported and used like:

import Border from \'./i         


        
3条回答
  •  甜味超标
    2021-01-12 02:32

    In Storybook 6, You have to import it like this:

    import { ReactComponent as Border } from './images/border.inline.svg'
    

    Try that if it also works for your version since this question is from a year ago.

提交回复
热议问题