We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I ran the following script off the documentation:
optimize.mjs
import { transform } from "@svgr/core"; const svgCode = ` <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <rect x="10" y="10" height="100" width="100" style="stroke:#ff0000; fill: #0000ff"/> </svg> `; const jsCode = transform.sync( svgCode, { icon: true }, { componentName: "MyComponent" } ); console.log(jsCode);
And ran it with Node. The output was
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <rect x="10" y="10" height="100" width="100" style="stroke:#ff0000; fill: #0000ff"/> </svg>
I expected the output to be in React syntax.
I used v3.0.2 of the package.
The text was updated successfully, but these errors were encountered:
yea this happens also in next js, when i using the app router endpoint
Sorry, something went wrong.
@JonnyBurger I think the config may need the plugins: ['@svgr/plugin-jsx'] part to transform to JSX. Otherwise it only transforms the SVG.
plugins: ['@svgr/plugin-jsx']
I was running into the same issue and @rossmoody suggestion worked for me. Thanks 🙇
No branches or pull requests
I ran the following script off the documentation:
optimize.mjs
And ran it with Node. The output was
I expected the output to be in React syntax.
I used v3.0.2 of the package.
The text was updated successfully, but these errors were encountered: