π Bug Report
When using jsxRuntime: 'classic-preact' option in @svgr/webpack, emitted module includes React namespace reference which is not defined by default.
To Reproduce
- Use
@svgr/webpack
- Configure webpack.config for
.svg file to use @svgr/webpack with jsxRuntime: 'classic-preact':
rules: [
{
test: /\.svg$/i,
use: {
loader: '@svgr/webpack',
options: {
jsxRuntime: 'classic-preact',
}
}
}
]
- Build files
Expected behavior
svg modules uses preact-related API only
(Actual behavior: svg modules uses React.createElement instead of preact API)
Link to repl or repo (highly encouraged)
https://github.com/jet2jet/svgr-preact-test
Run npx envinfo --system --binaries --npmPackages @svgr/core,@svgr/cli,@svgr/webpack,@svgr/rollup --markdown --clipboard
Paste the results here:
## System:
- OS: Linux 6.6 Ubuntu 22.04.5 LTS 22.04.5 LTS (Jammy Jellyfish)
- CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
- Memory: 5.30 GB / 7.58 GB
- Container: Yes
- Shell: 5.1.16 - /bin/bash
## Binaries:
- Node: 20.19.3 - /home/user/.asdf/installs/nodejs/v20.19.3/bin/node
- npm: 11.5.1 - /home/user/.asdf/installs/nodejs/v20.19.3/bin/npm
- pnpm: 8.7.1 - /home/user/.local/share/pnpm/pnpm
## npmPackages:
- @svgr/core: ^8.1.0 => 8.1.0
- @svgr/webpack: ^8.1.0 => 8.1.0
π Bug Report
When using
jsxRuntime: 'classic-preact'option in @svgr/webpack, emitted module includesReactnamespace reference which is not defined by default.To Reproduce
@svgr/webpack.svgfile to use@svgr/webpackwithjsxRuntime: 'classic-preact':Expected behavior
svg modules uses preact-related API only
(Actual behavior: svg modules uses
React.createElementinstead of preact API)Link to repl or repo (highly encouraged)
https://github.com/jet2jet/svgr-preact-test
Run
npx envinfo --system --binaries --npmPackages @svgr/core,@svgr/cli,@svgr/webpack,@svgr/rollup --markdown --clipboardPaste the results here: