From 6f27f5ef88b84416169776f4d1941505b89f8a68 Mon Sep 17 00:00:00 2001 From: Daniel Kuhn Date: Wed, 4 Sep 2024 15:56:56 +0200 Subject: [PATCH] Refactor defaultProps to default parameters --- packages/table-plugin/src/HTMLTable.tsx | 18 +++--------------- packages/table-plugin/src/types.ts | 2 +- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/packages/table-plugin/src/HTMLTable.tsx b/packages/table-plugin/src/HTMLTable.tsx index 9f23503..fdffba4 100644 --- a/packages/table-plugin/src/HTMLTable.tsx +++ b/packages/table-plugin/src/HTMLTable.tsx @@ -259,15 +259,15 @@ export const HTMLTable = function HTMLTable({ cssRules, html, sourceBaseUrl, - animationType, + animationType = 'animated', computeHeuristicContentHeight = defaultComputeHeuristicContentHeight, computeContainerHeight = defaultComputeContainerHeight, webViewProps: userWebViewProps, style, onLinkPress, - animationDuration, + animationDuration = DEFAULT_TRANSITION_DURATION, htmlAttribs, - maxScale, + maxScale = 1, ...stats }: HTMLTableProps) { const onDOMLinkPress = useCallback( @@ -331,18 +331,6 @@ const propTypes: Record = { displayMode: PropTypes.oneOf(['flex', 'expand']) }; -const defaultProps = { - animationDuration: DEFAULT_TRANSITION_DURATION, - animationType: 'animated', - computeHeuristicContentHeight: defaultComputeHeuristicContentHeight, - computeContainerHeight: defaultComputeContainerHeight, - maxScale: 1 -}; - Object.defineProperty(HTMLTable, 'propTypes', { value: propTypes }); - -Object.defineProperty(HTMLTable, 'defaultProps', { - value: defaultProps -}); diff --git a/packages/table-plugin/src/types.ts b/packages/table-plugin/src/types.ts index 2a6a7f8..d2cd913 100644 --- a/packages/table-plugin/src/types.ts +++ b/packages/table-plugin/src/types.ts @@ -234,7 +234,7 @@ export interface TableConfig { * * @defaultValue 1 */ - maxScale?: boolean; + maxScale?: number; /** * Container style.