From 747d1ca288688d5bc13e17cb1193bbdd93bc0d09 Mon Sep 17 00:00:00 2001 From: Vencislav Atanasov Date: Sun, 9 Jun 2024 00:17:50 +0300 Subject: [PATCH] Replace defaultProps usage with JavaScript default parameters --- src/widgets/DeviceActionButton/DeviceActionButton.jsx | 6 +----- src/widgets/icons/LoadingIcon.jsx | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/widgets/DeviceActionButton/DeviceActionButton.jsx b/src/widgets/DeviceActionButton/DeviceActionButton.jsx index d462c9a..c17c14a 100644 --- a/src/widgets/DeviceActionButton/DeviceActionButton.jsx +++ b/src/widgets/DeviceActionButton/DeviceActionButton.jsx @@ -35,7 +35,7 @@ const types = { const DeviceActionButton = ({ deviceId, action, - isDoorOpen, + isDoorOpen = false, }) => { const [ disabled, setDisabled ] = useState(false); @@ -75,8 +75,4 @@ const DeviceActionButton = ({ ); }; -DeviceActionButton.defaultProps = { - isDoorOpen: false, -}; - export default DeviceActionButton; diff --git a/src/widgets/icons/LoadingIcon.jsx b/src/widgets/icons/LoadingIcon.jsx index 2011cfe..9fa8967 100644 --- a/src/widgets/icons/LoadingIcon.jsx +++ b/src/widgets/icons/LoadingIcon.jsx @@ -3,17 +3,13 @@ import PropTypes from 'prop-types'; import { Spinner } from 'react-bootstrap'; const LoadingIcon = ({ - large, + large = false, }) => { return ( ); }; -LoadingIcon.defaultProps = { - large: false, -}; - LoadingIcon.propTypes = { large: PropTypes.bool, };