Answers for "svg component react js"

13

how to use svg in react js

import React from 'react';
import LogoName from '../assets/logo.svg'

const Header = () => {
    return ( 
        <div>
           	<img src={LogoName} alt="logo"/>
        </div>
     );
}
Posted by: Guest on September-28-2020
1

how to import svg in react

//customIcon.js

import React from "react";
import {ReactComponent as ImportedSVG} from "path/to/myIcon.svg";
import { SvgIcon } from '@material-ui/core';

function CustomIcon() {
 return(
  <SvgIcon component={ImportedSVG} viewBox="0 0 384 512"/>

)
}

export default CustomIcon;
Posted by: Guest on June-18-2021
0

svg component react js

import { ReactComponent as IconMenu } from './icons/menu.svg'

<IconMenu />
Posted by: Guest on April-04-2022
4

react svg

//Use this WEB APP to convert any svg to a valide reactJs or React native Component
Playground - SVGR
https://react-svgr.com/playground/
Posted by: Guest on August-09-2021

Code answers related to "svg component react js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language