svgr icon indicating copy to clipboard operation
svgr copied to clipboard

Width & Height attributes didn’t work with viewBox

Open Shramkoweb opened this issue 1 year ago • 4 comments

🐛 Bug Report

width & height attributes didn’t work with viewBox. I need to be able to keep the width & height + viewBox but it didn't work.

To Reproduce

Steps to reproduce the behavior:

  1. Add all dimensions options in configuration https://react-svgr.com/docs/options/#dimensions
  2. Width & Height attributes didn’t work with viewBox

Expected behavior

Width & Height attributes work with viewBox

Link to repl or repo (highly encouraged)

Please provide a minimal repository on GitHub.

Issues without a reproduction link are likely to stall.

Run npx envinfo --system --binaries --npmPackages @svgr/core,@svgr/cli,@svgr/webpack,@svgr/rollup --markdown --clipboard

Paste the results here:


Shramkoweb avatar May 24 '23 17:05 Shramkoweb

I'm also noticing this, after updating all my viewboxes have been removed

Tasemu avatar Sep 18 '23 13:09 Tasemu

any fix for this?

3den avatar Jan 04 '24 00:01 3den

???

Shramkoweb avatar Jan 15 '24 04:01 Shramkoweb

This may help. https://react-svgr.com/docs/migrate/#svgo

zhengjitf avatar Mar 18 '24 08:03 zhengjitf