From a90c13e86f798841cb6db038bb6b6d1408a00585 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sat, 21 Dec 2024 16:42:25 -0800 Subject: [PATCH] Remove defaultProps from TypeScript components --- .../Form/Select/HintedSelectInputOption.tsx | 14 ++++---------- .../Components/Form/Select/IndexerSelectInput.tsx | 5 ----- frontend/src/Components/Form/Tag/TagInput.tsx | 12 ------------ 3 files changed, 4 insertions(+), 27 deletions(-) diff --git a/frontend/src/Components/Form/Select/HintedSelectInputOption.tsx b/frontend/src/Components/Form/Select/HintedSelectInputOption.tsx index faa9081c5..2aba9ddae 100644 --- a/frontend/src/Components/Form/Select/HintedSelectInputOption.tsx +++ b/frontend/src/Components/Form/Select/HintedSelectInputOption.tsx @@ -5,9 +5,11 @@ import EnhancedSelectInputOption, { } from './EnhancedSelectInputOption'; import styles from './HintedSelectInputOption.css'; -interface HintedSelectInputOptionProps extends EnhancedSelectInputOptionProps { +interface HintedSelectInputOptionProps + extends Omit { value: string; hint?: React.ReactNode; + isSelected?: boolean; } function HintedSelectInputOption(props: HintedSelectInputOptionProps) { @@ -17,7 +19,7 @@ function HintedSelectInputOption(props: HintedSelectInputOptionProps) { hint, depth, isSelected = false, - isDisabled, + isMultiSelect, isMobile, ...otherProps } = props; @@ -27,8 +29,6 @@ function HintedSelectInputOption(props: HintedSelectInputOptionProps) { id={id} depth={depth} isSelected={isSelected} - isDisabled={isDisabled} - isHidden={isDisabled} isMobile={isMobile} {...otherProps} > @@ -43,10 +43,4 @@ function HintedSelectInputOption(props: HintedSelectInputOptionProps) { ); } -HintedSelectInputOption.defaultProps = { - isDisabled: false, - isHidden: false, - isMultiSelect: false, -}; - export default HintedSelectInputOption; diff --git a/frontend/src/Components/Form/Select/IndexerSelectInput.tsx b/frontend/src/Components/Form/Select/IndexerSelectInput.tsx index 4bb4ff787..3e9f61ebc 100644 --- a/frontend/src/Components/Form/Select/IndexerSelectInput.tsx +++ b/frontend/src/Components/Form/Select/IndexerSelectInput.tsx @@ -42,7 +42,6 @@ interface IndexerSelectInputConnectorProps { name: string; value: number; includeAny?: boolean; - values: object[]; onChange: (change: EnhancedSelectInputChanged) => void; } @@ -74,8 +73,4 @@ function IndexerSelectInput({ ); } -IndexerSelectInput.defaultProps = { - includeAny: false, -}; - export default IndexerSelectInput; diff --git a/frontend/src/Components/Form/Tag/TagInput.tsx b/frontend/src/Components/Form/Tag/TagInput.tsx index bde24f369..c99564073 100644 --- a/frontend/src/Components/Form/Tag/TagInput.tsx +++ b/frontend/src/Components/Form/Tag/TagInput.tsx @@ -356,16 +356,4 @@ TagInput.propTypes = { onTagReplace: PropTypes.func, }; -TagInput.defaultProps = { - className: styles.internalInput, - inputContainerClassName: styles.input, - allowNew: true, - kind: kinds.INFO, - placeholder: '', - delimiters: ['Tab', 'Enter', ' ', ','], - minQueryLength: 1, - canEdit: false, - tagComponent: TagInputTag, -}; - export default TagInput;