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

后端 未结 3 2008
抹茶落季
抹茶落季 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:17

    I got it working with

    ...
    module.exports = {
      module: {
        rules: [
          {
            test: /\.inline.svg$/,
            loader: 'svg-react-loader'
          }
        ]
      }
    }
    

提交回复
热议问题