Skip to content
New issue

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

--icon requires a size be entered #668

Closed
alexistbell opened this issue Jan 27, 2022 · 4 comments · Fixed by #671
Closed

--icon requires a size be entered #668

alexistbell opened this issue Jan 27, 2022 · 4 comments · Fixed by #671
Labels
docs 📝 Documentation

Comments

@alexistbell
Copy link

I was trying to convert some svgs using the command line and the --icon flag. https://react-svgr.com/docs/options/ does not make it clear that you must pass in a value for width and height, it implies its optional and that it will default to 1em if you don't pass in a value. When I tried this the output of my new file was just the --help text.

Here's what I was trying in case I had some other syntax error

svgr --icon students-blue.svg > StudentsBlue.jsx

Either the documentation should be updated to show this is a required value, or it should default to 1em as the documentation implies.

@FDiskas
Copy link

FDiskas commented Jan 27, 2022

@alexistbell
Copy link
Author

That's a good explanation of what the problem I ran into is, I would still recommend updating the documentation for icon. This was my first time using the cli tool so it didn't occur to me to look under migration for old versions. That seemed more relevant to use svgr with webpack etc.

@FDiskas
Copy link

FDiskas commented Jan 27, 2022

I would suggest you to use svgr config file instead of passing arguments to cli.

@gregberge
Copy link
Owner

Hi @alexistbell, you are right, docs should reflect it.

@gregberge gregberge added the docs 📝 Documentation label Jan 29, 2022
gregberge added a commit that referenced this issue Jan 29, 2022
gregberge added a commit that referenced this issue Jan 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs 📝 Documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants