From 3362d855a9e1ac637970b9cc2420443dad0b7f65 Mon Sep 17 00:00:00 2001 From: marlo-longley Date: Tue, 29 Oct 2024 17:31:26 -0500 Subject: [PATCH 1/2] Stop using defaultProps in MosaicRenderPreview component --- src/components/MosaicRenderPreview.js | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/components/MosaicRenderPreview.js b/src/components/MosaicRenderPreview.js index 201a650a3..a0ae3ea0c 100644 --- a/src/components/MosaicRenderPreview.js +++ b/src/components/MosaicRenderPreview.js @@ -2,25 +2,24 @@ import PropTypes from 'prop-types'; import MinimalWindow from '../containers/MinimalWindow'; /** - * MosaicRenderPreview is used to for the preview when dragging a mosaic window/tile -*/ -export function MosaicRenderPreview(props) { - const { - t, title, windowId, - } = props; - + * MosaicRenderPreview is used for the preview when dragging a mosaic window/tile + */ +export function MosaicRenderPreview({ + t = k => k, + title = '', + windowId = '', +}) { return ( - + ); } MosaicRenderPreview.propTypes = { t: PropTypes.func, title: PropTypes.string, - windowId: PropTypes.string.isRequired, // eslint-disable-line react/no-unused-prop-types -}; - -MosaicRenderPreview.defaultProps = { - t: k => k, - title: '', + windowId: PropTypes.string.isRequired, }; From db13611b4cd35352328b2bcf8dace6b15723f4d1 Mon Sep 17 00:00:00 2001 From: marlo-longley Date: Wed, 30 Oct 2024 11:49:20 -0500 Subject: [PATCH 2/2] Disable react/require-default-props eslint rule --- .eslintrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.eslintrc b/.eslintrc index 596e1115f..6d549eac2 100644 --- a/.eslintrc +++ b/.eslintrc @@ -44,6 +44,7 @@ }], "react/jsx-uses-react": "off", "react/react-in-jsx-scope": "off", + "react/require-default-props": "off", "react-hooks/exhaustive-deps": "error", "testing-library/render-result-naming-convention": "off", "testing-library/no-render-in-lifecycle": [