1import React from 'react';
2import { ReactComponent as BrandIcon } from "./assets/brand-icon.svg";
3
4export default function(){
5 return(
6 <div>
7 <BrandIcon />
8 </div>
9 );
10}
1import React from 'react';
2import LogoName from '../assets/logo.svg'
3
4const Header = () => {
5 return (
6 <div>
7 <img src={LogoName} alt="logo"/>
8 </div>
9 );
10}
1//customIcon.js
2
3import React from "react";
4import {ReactComponent as ImportedSVG} from "path/to/myIcon.svg";
5import { SvgIcon } from '@material-ui/core';
6
7function CustomIcon() {
8 return(
9 <SvgIcon component={ImportedSVG} viewBox="0 0 384 512"/>
10
11)
12}
13
14export default CustomIcon;
15
1import React from 'react';
2import {ReactComponent as ReactLogo} from './logo.svg';
3
4const App = () => {
5 return (
6 <div className="App">
7 <ReactLogo />
8 </div>
9 );
10}
11export default App;
1//Use this WEB APP to convert any svg to a valide reactJs or React native Component
2Playground - SVGR
3https://react-svgr.com/playground/