From 15f09c9c9c98f0fb4288a496fda3370e199734ac Mon Sep 17 00:00:00 2001 From: Ernst Widerberg Date: Tue, 7 Jun 2022 16:50:32 +0200 Subject: Make functional: Error --- src/components/Error.js | 52 ++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 27 deletions(-) (limited to 'src') diff --git a/src/components/Error.js b/src/components/Error.js index 4d026bc..086dcea 100644 --- a/src/components/Error.js +++ b/src/components/Error.js @@ -5,33 +5,31 @@ import Alert from "@mui/material/Alert"; import AlertTitle from "@mui/material/AlertTitle"; import Button from "@mui/material/Button"; -class Error extends React.Component { - static propTypes = { - clearError: PropTypes.func.isRequired, - clearToken: PropTypes.func.isRequired, - error: PropTypes.string.isRequired - }; - - render() { - return ( -
- - Internal server error -

{this.props.error}

- -
-
- ); - } +function Error(props) { + return ( +
+ + Internal server error +

{props.error}

+ +
+
+ ); } +Error.propTypes = { + clearError: PropTypes.func.isRequired, + clearToken: PropTypes.func.isRequired, + error: PropTypes.string.isRequired +}; + export default Error; -- cgit v1.1