diff --git a/src/components/NotifyAndRedirect.jsx b/src/components/NotifyAndRedirect.jsx
index 1741c8813a..0bb030440a 100644
--- a/src/components/NotifyAndRedirect.jsx
+++ b/src/components/NotifyAndRedirect.jsx
@@ -1,4 +1,4 @@
-import React, { Component } from 'react';
+import React from 'react';
import { Redirect, withRouter } from 'react-router-dom';
@@ -6,39 +6,39 @@ import { Trans } from '@lingui/macro';
import { withRootDialog } from '../contexts/RootDialog';
-class NotifyAndRedirect extends Component {
- constructor (props) {
- super(props);
+const NotifyAndRedirect = ({
+ to,
+ push,
+ from,
+ exact,
+ strict,
+ sensitive,
+ setRootDialogMessage,
+ location
+}) => {
+ setRootDialogMessage({
+ title: '404',
+ bodyText: (
+
+ Cannot find route
+ {` ${location.pathname}`}
+ .
+
+ ),
+ variant: 'warning'
+ });
- const { setRootDialogMessage, location } = this.props;
- setRootDialogMessage({
- title: '404',
- bodyText: (
-
- Cannot find route
- {` ${location.pathname}`}
- .
-
- ),
- variant: 'warning'
- });
- }
-
- render () {
- const { to, push, from, exact, strict, sensitive } = this.props;
-
- return (
-
- );
- }
-}
+ return (
+
+ );
+};
export { NotifyAndRedirect as _NotifyAndRedirect };
export default withRootDialog(withRouter(NotifyAndRedirect));