jhamlet / svg-react-loader

Webpack SVG to React Component Loader
MIT License
559 stars 82 forks source link

svg loader re-arranges internal elements #38

Closed kmcmichael-twist closed 8 years ago

kmcmichael-twist commented 8 years ago

I'm having a problem with the loader re-ordering the elements in the SVG and, because z-index is implied by order, this is breaking my svg images. I have found a work-around but I shouldn't need to edit my svg to get the loader to work properly.

Original svg: ` <?xml version="1.0"?>

` This file loads into my react app with the ordering of the elements changed (and thus some background elements move to the foreground). If I wrap the last three path elements in a tag, the ordering is preserved after load - but needing to arbitrarily edit the svg is a huge problem...
jhamlet commented 8 years ago

@kmcmichael-twist This is a duplicate of #26 and has been fixed in the v0.4.0 branch.

You can try the latest by npm install svg-react-loader@next to see if your problem goes away (if it doesn't please reopen this issue).

I haven't released v0.4.0 as latest yet because I haven't had the time to generate sufficient test coverage.