Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions docusaurus/docs/adding-images-fonts-and-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,15 @@ One way to add SVG files was described in the section above. You can also import

```js
import { ReactComponent as Logo } from './logo.svg';
const App = () => (
<div>
{/* Logo is an actual React component */}
<Logo />
</div>
);

function App() {
return (
<div>
{/* Logo is an actual React component */}
<Logo />
</div>
);
}
```

This is handy if you don't want to load SVG as a separate file. Don't forget the curly braces in the import! The `ReactComponent` import name is significant and tells Create React App that you want a React component that renders an SVG, rather than its filename.
Expand Down
2 changes: 1 addition & 1 deletion packages/cra-template-typescript/template/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import logo from './logo.svg';
import './App.css';

const App = () => {
function App() {
return (
<div className="App">
<header className="App-header">
Expand Down