Skip to content

Commit

Permalink
chore: replace deprecated react-helmet with react-helmet-async for st…
Browse files Browse the repository at this point in the history
…rict mode
  • Loading branch information
Caleb Kang committed Apr 26, 2021
1 parent 5f2a486 commit 9908322
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 38 deletions.
27 changes: 0 additions & 27 deletions webui/react/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 webui/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"query-string": "^6.13.5",
"react": "^16.14.0",
"react-dom": "^16.14.0",
"react-helmet": "^6.1.0",
"react-helmet-async": "^1.0.9",
"react-monaco-editor": "^0.37.0",
"react-router-dom": "^5.2.0",
"react-scripts": "^4.0.3",
Expand Down Expand Up @@ -82,7 +82,6 @@
"@types/plotly.js": "^1.50.21",
"@types/react": "^16.9.52",
"@types/react-dom": "^16.9.8",
"@types/react-helmet": "^6.1.0",
"@types/react-router-dom": "^5.1.6",
"@types/react-transition-group": "^4.4.0",
"@types/resize-observer-browser": "^0.1.4",
Expand Down
9 changes: 6 additions & 3 deletions webui/react/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Button, notification } from 'antd';
import React, { useEffect, useLayoutEffect, useState } from 'react';
import { HelmetProvider } from 'react-helmet-async';

import { setupAnalytics } from 'Analytics';
import Link from 'components/Link';
Expand Down Expand Up @@ -74,9 +75,11 @@ const AppView: React.FC = () => {

const App: React.FC = () => {
return (
<StoreProvider>
<AppView />
</StoreProvider>
<HelmetProvider>
<StoreProvider>
<AppView />
</StoreProvider>
</HelmetProvider>
);
};

Expand Down
2 changes: 1 addition & 1 deletion webui/react/src/components/Page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Helmet } from 'react-helmet';
import { Helmet } from 'react-helmet-async';

import PageHeader from 'components/PageHeader';
import { useStore } from 'contexts/Store';
Expand Down
6 changes: 1 addition & 5 deletions webui/react/src/pages/SignIn.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { notification } from 'antd';
import queryString from 'query-string';
import React, { useEffect, useState } from 'react';
import { Helmet } from 'react-helmet';
import { useLocation } from 'react-router-dom';

import AuthToken from 'components/AuthToken';
Expand Down Expand Up @@ -75,11 +74,8 @@ const SignIn: React.FC = () => {
* accessing a page from the browser when the user is already verified.
*/
return auth.checked ? (
<Page>
<Page docTitle="Sign In - Determined">
<div className={css.base}>
<Helmet>
<title>Sign In - Determined</title>
</Helmet>
<div className={css.content}>
<Logo type={LogoTypes.OnLightVertical} />
<DeterminedAuth canceler={canceler} />
Expand Down

0 comments on commit 9908322

Please sign in to comment.