Skip to content

Instantly share code, notes, and snippets.

@corocoto
Last active July 31, 2020 08:32
Show Gist options
  • Select an option

  • Save corocoto/c260a0ea32690bb543b899255716edb4 to your computer and use it in GitHub Desktop.

Select an option

Save corocoto/c260a0ea32690bb543b899255716edb4 to your computer and use it in GitHub Desktop.
Loading SVG image as Component in Create React App project
import { ReactComponent as Logo } from './logo.svg';
function App() {
return (
<div>
<Logo title="logo"/>
</div>
);
}
/* Tip: The imported SVG React Component accepts a title prop along with other props that a svg element accepts.
Use this prop to add an accessible title to your svg component. */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment