-
-
Notifications
You must be signed in to change notification settings - Fork 420
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
Issue with loading SVG sprite #36
Comments
It is very strange. Thanks for reporting it. |
It was not a bug but a feature, it is removed by SVGO. I added an option to keep useless defs. See #42. Will be part of next release. |
Perfect! Thank you :) |
Same error loading sprite:
result:
here is config:
|
Also I have try to load simple svg, all working correct |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm trying to load an SVG file as a React component. I found a PR facebook/create-react-app#3718 by @iansu that solves the problem.
However there is an issue with reading the SVG file contents.
Issue
I have the following SVG file (it was generated by [svg-sprite]):(https://www.npmjs.com/package/svg-sprite)
which is being imported as:
As you see the
<svg />
element is empty.Workaround
I was able to find a workaround to the above. All works fine if I add
<defs />
element that includes<style />
element:which returns a proper
<svg />
element and its contents:Expected scenario
The SVG example from Issue section should be loaded correctly (with its contents) without adding some extra tags.
The text was updated successfully, but these errors were encountered: