"SVG as a component" doesn't quite work in 2.x
Created by: gaearon
We merged https://github.com/facebookincubator/create-react-app/pull/3718 and released the first 2.x alpha, but quickly discovered a few issues:
- Importing SVG from CSS is now broken, you get
[Object object]
in URLs. - While that can be fixed by adding a named export called
toString()
here (which would just return the URL), it looks like the resulting JS bundle contains the React component as soon as CSS imports it. It's my impression that webpack CSS pipeline still relies on CommonJS and therefore can't tree shake the component.
I'm not sure if there's any solution even possible here
Just in case, pinging @neoziro @iansu for more ideas.