This repository has been archived by the owner on Sep 20, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 129
<Visa width={20} /> does not scale #96
Comments
What is the Visa component a reference to in your case? Is that the svg or your own component? |
It is svgr that turn it into a react component. |
Have you tried using |
No I did not, I might have a look in the future, but I do not always have svgr and I still expect svg to be scalable, I prefer to use the wrapper to set the dimensions. This is the reason why I always set the dimensions to 100% in my svg. |
I had the same issue and it works (at least on web) with this webpack config:
Now I can scale the icons from CSS |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi and thanks for sharing.
I am a package author and also have some experience with svg package made for react.
In a react-native project, I am using
<Visa width={20} />
and at my big surprise, those svg does not scale.For scaling, you need to set
width=100%
andheight=100%
from<svg />
, theviewBox="0 0 750 471"
is enough.Just because of this, this package became useless and I had to import all those files manually in my projects.
The text was updated successfully, but these errors were encountered: