Closed nathanjhood closed 3 weeks ago
Add a React component export to the '*.svg' module declaration:
'*.svg'
declare module "*.svg" { import * as React from "react"; export const ReactComponent: React.FunctionComponent< React.SVGProps<SVGSVGElement> & { title?: string } >; const src: string; export default src; }
Import the React component part of the module:
import { ReactComponent as Logo} from './logo.svg'; import './App.css'; function App() { return ( <div className="App"> <Logo /> </div> ); } export default App;
I wonder if we can coerce HTML files in the same way :) (reference #16 )
Solved ages ago...
Add a React component export to the
'*.svg'
module declaration:Import the React component part of the module:
I wonder if we can coerce HTML files in the same way :) (reference #16 )