Skip to content

Commit e084318

Browse files
committed
add Helmet for SEO
1 parent 1d8cf3c commit e084318

3 files changed

Lines changed: 13 additions & 1 deletion

File tree

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
"prop-types": "^15.7.2",
7878
"react": "^17.0.1",
7979
"react-dom": "^17.0.1",
80+
"react-helmet": "^6.1.0",
8081
"react-query": "^3.6.0",
8182
"shelljs": "^0.8.4"
8283
}

readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Axios & React-Query<br>
1010
PropTypes<br>
1111
ESLint & Prettier<br>
1212
Husky for Pre-commit lint&formatting of changed files<br>
13+
SEO support through Helmet<br>
1314
Env Files<br>
1415

1516
## Setup

src/components/App.jsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react';
22
const AppContext = React.createContext();
3+
import { Helmet } from 'react-helmet';
34

45
export const App = () => {
56
return (
@@ -10,7 +11,16 @@ export const App = () => {
1011
}
1112
}
1213
>
13-
<div>App</div>
14+
<div>
15+
<Helmet>
16+
<title>{`My App`}</title>
17+
<meta
18+
name="description"
19+
content="This is what you want to show as the page content in the Google SERP Listing"
20+
/>
21+
</Helmet>
22+
App
23+
</div>
1424
</AppContext.Provider>
1525
);
1626
};

0 commit comments

Comments
 (0)