diff --git a/generators/client/templates/react/src/main/webapp/app/shared/error/error-loading.tsx.ejs b/generators/client/templates/react/src/main/webapp/app/shared/error/error-loading.tsx.ejs index f58043284fbe..0d455ebed7ee 100644 --- a/generators/client/templates/react/src/main/webapp/app/shared/error/error-loading.tsx.ejs +++ b/generators/client/templates/react/src/main/webapp/app/shared/error/error-loading.tsx.ejs @@ -2,14 +2,12 @@ import React from 'react'; import { Translate } from 'react-jhipster'; import { Alert } from 'reactstrap'; -class ErrorLoading extends React.Component { - render() { - return ( -
- Error loading component -
- ); - } -} +const ErrorLoading = () => { + return ( +
+ Error loading component +
+ ); +}; export default ErrorLoading as React.ComponentType; diff --git a/generators/client/templates/react/src/main/webapp/app/shared/error/page-not-found.tsx.ejs b/generators/client/templates/react/src/main/webapp/app/shared/error/page-not-found.tsx.ejs index fff53097c2b4..b112c719ad43 100644 --- a/generators/client/templates/react/src/main/webapp/app/shared/error/page-not-found.tsx.ejs +++ b/generators/client/templates/react/src/main/webapp/app/shared/error/page-not-found.tsx.ejs @@ -2,18 +2,14 @@ import React from 'react'; import { Translate } from 'react-jhipster'; import { Alert } from 'reactstrap'; -class PageNotFound extends React.Component { - render() { - return ( -
- - - The page does not exist. - - -
- ); - } -} +const PageNotFound = () => { + return ( +
+ + The page does not exist. + +
+ ); +}; export default PageNotFound; diff --git a/generators/client/templates/react/src/main/webapp/app/shared/layout/menus/menu-item.tsx.ejs b/generators/client/templates/react/src/main/webapp/app/shared/layout/menus/menu-item.tsx.ejs index 0744a9d0cd9b..41040ab204ea 100644 --- a/generators/client/templates/react/src/main/webapp/app/shared/layout/menus/menu-item.tsx.ejs +++ b/generators/client/templates/react/src/main/webapp/app/shared/layout/menus/menu-item.tsx.ejs @@ -23,22 +23,22 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { IconProp } from '@fortawesome/fontawesome-svg-core'; export interface IMenuItem { + children: React.ReactNode; icon: IconProp; to: string; id?: string; - "data-cy"?: string; - children?: React.ReactNode + 'data-cy'?: string; } -export default class MenuItem extends React.Component { +const MenuItem = (props: IMenuItem) => { + const { to, icon, id, children } = props; - render() { - const { to, icon, id, children } = this.props; + return ( + + {children} + + ); +}; + +export default MenuItem; - return ( - - {children} - - ); - } -}