Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
perf(react-helm): migrate react-helmet to react-helmet-async
Browse files Browse the repository at this point in the history
- uninstall react-helmet and @types/react-helmet
- install react-helmet-async
- update index.js
and PageTitle for migration

re #22
  • Loading branch information
LinHuiqing committed Sep 30, 2021
1 parent 3f7ea57 commit 115944f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 25 deletions.
29 changes: 8 additions & 21 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"react-draft-wysiwyg": "^1.14.7",
"react-ga": "^3.3.0",
"react-google-recaptcha": "^2.1.0",
"react-helmet": "6.1.0",
"react-helmet-async": "^1.1.2",
"react-hook-form": "^7.16.1",
"react-icons": "^4.2.0",
"react-query": "^3.24.4",
Expand Down Expand Up @@ -64,7 +64,6 @@
"@types/html-to-draftjs": "^1.4.0",
"@types/react-draft-wysiwyg": "^1.13.2",
"@types/react-google-recaptcha": "^2.1.2",
"@types/react-helmet": "^6.1.2",
"@types/react-router-dom": "^5.3.0",
"@types/styled-components": "^5.1.14",
"@typescript-eslint/eslint-plugin": "^4.32.0",
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/PageTitle/PageTitle.component.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Helmet from 'react-helmet'
import { Helmet } from 'react-helmet-async'

const PageTitle = ({
title,
Expand Down
5 changes: 4 additions & 1 deletion client/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { BrowserRouter } from 'react-router-dom'
import { QueryClient, QueryClientProvider } from 'react-query'
import { ReactQueryDevtools } from 'react-query/devtools'
import ScrollToTop from './components/ScrollToTop/ScrollToTop.component'
import { HelmetProvider } from 'react-helmet-async'

import App from './App'

Expand All @@ -16,7 +17,9 @@ ReactDOM.render(
<ReactQueryDevtools initialIsOpen={false} />
<BrowserRouter>
<ScrollToTop />
<App />
<HelmetProvider>
<App />
</HelmetProvider>
</BrowserRouter>
</QueryClientProvider>
</React.StrictMode>,
Expand Down

0 comments on commit 115944f

Please sign in to comment.