Add SVGs as React Components with Create React App 2.0

Share this video with your friends

Send Tweet

create-react-app version 2.0 added a lot of new features. One of the new features is added the svgr webpack loader to wrap SVGs in React components as a named export. This let’s you either grab the filename from the default export or grab a wrapped SVG component depending on your needs.