-
Notifications
You must be signed in to change notification settings - Fork 82
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
Unknown prop xmlns
on <svg> tag with React 15.2.0
#25
Comments
@udovenko Here is a quickfix, that you can use until this is solved: Install module.exports = {
module: {
loaders: [
{
test: /\/icons\/(.*)\.svg(\?.*)?$/,
loader: 'babel!svg-react' +
// removes xmlns tag from svg (see https://github.com/jhamlet/svg-react-loader/issues/25)
'!string-replace?search=%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22&replace='
}
]
}
} Now you can require SVGs like import FoobarIcon from './icons/foobar.svg?name=FoobarIcon' |
Thank you so much! Will try this fix as soon as possible! |
Having the same issue. This might help you fix it, @udovenko . Evidently, according to react devs, you don't even need the xmlns attribute. You can leave it out. |
In addition to the quickfix provided by @choffmeister (thank you so much for that!) I bumped into loader: 'babel!svg-react' +
// removes xmlns tag from svg (see https://github.com/jhamlet/svg-react-loader/issues/25)
'!string-replace?search=%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22&replace=' +
// removes data-name attributes
'!string-replace?search=%20data-name%3D%22%5B%5Cw%5Cs_-%5D*%22&replace=&flags=ig' |
Putting this on the roadmap as React@>0.14 does a bit more with svgs now. @choffmeister Thanks for commenting and helping find a work-a-round. |
Closes jhamlet#25
Fixed(?) with v0.4.0-beta.2 |
Hi! After upgrading to React 15.2.0 I got this warning:
warning.js?0260:44Warning: Unknown prop
xmlns
on tag. Remove this prop from the element. For details, see https://fb.me/react-unknown-propin svg (created by TekoaLogo)

in TekoaLogo (created by Header)
in a (created by Link)
in Link (created by IndexLink)
...
The text was updated successfully, but these errors were encountered: