Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
Replace react-helmet with react-helmet-async
Browse files Browse the repository at this point in the history
To resolve nfl/react-helmet#426 and remove
warning in console due to that issue.
  • Loading branch information
bobwhitelock committed Sep 30, 2021
1 parent 4d18db6 commit 637c13b
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 32 deletions.
32 changes: 17 additions & 15 deletions client/src/components/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { BrowserRouter as Router, Switch, Route } from "react-router-dom";
import { QueryClient, QueryClientProvider } from "react-query";
import { Helmet } from "react-helmet";
import { Helmet, HelmetProvider } from "react-helmet-async";

import * as urls from "urls";
import { Add } from "components/pages/Add";
Expand All @@ -12,20 +12,22 @@ const queryClient = new QueryClient();
export function App() {
return (
<QueryClientProvider client={queryClient}>
<Helmet defaultTitle="todotxt-ui" titleTemplate="%s | todotxt-ui" />
<Router>
<Switch>
<Route exact path={urls.root}>
<Root />
</Route>
<Route exact path={urls.add}>
<Add />
</Route>
<Route exact path={urls.edit.template}>
<Edit />
</Route>
</Switch>
</Router>
<HelmetProvider>
<Helmet defaultTitle="todotxt-ui" titleTemplate="%s | todotxt-ui" />
<Router>
<Switch>
<Route exact path={urls.root}>
<Root />
</Route>
<Route exact path={urls.add}>
<Add />
</Route>
<Route exact path={urls.edit.template}>
<Edit />
</Route>
</Switch>
</Router>
</HelmetProvider>
</QueryClientProvider>
);
}
2 changes: 1 addition & 1 deletion client/src/components/TaskForm.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useState, useRef, useEffect } from "react";
import cn from "classnames";
import { Redirect } from "react-router-dom";
import { Helmet } from "react-helmet";
import { Helmet } from "react-helmet-async";
import _ from "lodash";
import Tribute from "tributejs";
import "../../node_modules/tributejs/dist/tribute.css";
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/pages/Root.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import { Link } from "react-router-dom";
import { Helmet } from "react-helmet";
import { Helmet } from "react-helmet-async";

import * as Icon from "components/Icon";
import * as urls from "urls";
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"query-string": "^7.0.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-helmet": "^6.1.0",
"react-helmet-async": "^1.1.2",
"react-query": "^3.24.5",
"react-router-dom": "^5.3.0",
"react-scripts": "4.0.3",
Expand Down
36 changes: 22 additions & 14 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6110,6 +6110,13 @@ internal-slot@^1.0.3:
has "^1.0.3"
side-channel "^1.0.4"

invariant@^2.2.4:
version "2.2.4"
resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6"
integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==
dependencies:
loose-envify "^1.0.0"

ip-regex@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-2.1.0.tgz#fa78bf5d2e6913c911ce9f819ee5146bb6d844e9"
Expand Down Expand Up @@ -7356,7 +7363,7 @@ loglevel@^1.6.8:
resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.7.1.tgz#005fde2f5e6e47068f935ff28573e125ef72f197"
integrity sha512-Hesni4s5UkWkwCGJMQGAh71PaLUmKFM60dHvq0zi/vDhhrzuk+4GgNbTXJ12YYQJn6ZKBDNIjYcuQGKudvqrIw==

loose-envify@^1.1.0, loose-envify@^1.2.0, loose-envify@^1.3.1, loose-envify@^1.4.0:
loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.2.0, loose-envify@^1.3.1, loose-envify@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==
Expand Down Expand Up @@ -9568,20 +9575,21 @@ react-error-overlay@^6.0.9:
resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-6.0.9.tgz#3c743010c9359608c375ecd6bc76f35d93995b0a"
integrity sha512-nQTTcUu+ATDbrSD1BZHr5kgSD4oF8OFjxun8uAaL8RwPBacGBNPf/yAuVVdx17N8XNzRDMrZ9XcKZHCjPW+9ew==

react-fast-compare@^3.1.1:
react-fast-compare@^3.2.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/react-fast-compare/-/react-fast-compare-3.2.0.tgz#641a9da81b6a6320f270e89724fb45a0b39e43bb"
integrity sha512-rtGImPZ0YyLrscKI9xTpV8psd6I8VAtjKCzQDlzyDvqJA8XOW78TXYQwNRNd8g8JZnDu8q9Fu/1v4HPAVwVdHA==

react-helmet@^6.1.0:
version "6.1.0"
resolved "https://registry.yarnpkg.com/react-helmet/-/react-helmet-6.1.0.tgz#a750d5165cb13cf213e44747502652e794468726"
integrity sha512-4uMzEY9nlDlgxr61NL3XbKRy1hEkXmKNXhjbAIOVw5vcFrsdYbH2FEwcNyWvWinl103nXgzYNlns9ca+8kFiWw==
react-helmet-async@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/react-helmet-async/-/react-helmet-async-1.1.2.tgz#653b7e6bbfdd239c5dcd6b8df2811c7a363b8334"
integrity sha512-LTTzDDkyIleT/JJ6T/uqx7Y8qi1EuPPSiJawQY/nHHz0h7SPDT6HxP1YDDQx/fzcVxCqpWEEMS3QdrSrNkJYhg==
dependencies:
object-assign "^4.1.1"
"@babel/runtime" "^7.12.5"
invariant "^2.2.4"
prop-types "^15.7.2"
react-fast-compare "^3.1.1"
react-side-effect "^2.1.0"
react-fast-compare "^3.2.0"
shallowequal "^1.1.0"

react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.1:
version "16.13.1"
Expand Down Expand Up @@ -9702,11 +9710,6 @@ [email protected]:
optionalDependencies:
fsevents "^2.1.3"

react-side-effect@^2.1.0:
version "2.1.1"
resolved "https://registry.yarnpkg.com/react-side-effect/-/react-side-effect-2.1.1.tgz#66c5701c3e7560ab4822a4ee2742dee215d72eb3"
integrity sha512-2FoTQzRNTncBVtnzxFOk2mCpcfxQpenBMbk5kSVBg5UcPqV9fRbgY2zhb7GTWWOlpFmAxhClBDlIq8Rsubz1yQ==

react@^17.0.2:
version "17.0.2"
resolved "https://registry.yarnpkg.com/react/-/react-17.0.2.tgz#d0b5cc516d29eb3eee383f75b62864cfb6800037"
Expand Down Expand Up @@ -10407,6 +10410,11 @@ sha.js@^2.4.0, sha.js@^2.4.8:
inherits "^2.0.1"
safe-buffer "^5.0.1"

shallowequal@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/shallowequal/-/shallowequal-1.1.0.tgz#188d521de95b9087404fd4dcb68b13df0ae4e7f8"
integrity sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==

shebang-command@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea"
Expand Down

0 comments on commit 637c13b

Please sign in to comment.