SVGR support
React Preview supports SVGR out of the box:
import { ReactComponent as Logo } from "./logo.svg";
If you want to use default imports instead (for example if you're using react-svg-loader
), you will need to customise reactpreview.config.js
:
/reactpreview.config.js
const reactpreview = require("@reactpreview/config");
module.exports = reactpreview.config({ svgr: { componentName: "default", },});