Last active
July 31, 2020 08:32
-
-
Save corocoto/c260a0ea32690bb543b899255716edb4 to your computer and use it in GitHub Desktop.
Loading SVG image as Component in Create React App project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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