Skip to content

Commit

Permalink
Refactor defaultProps to default parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielKuhn committed Sep 4, 2024
1 parent 140b6fb commit 6f27f5e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
18 changes: 3 additions & 15 deletions packages/table-plugin/src/HTMLTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -331,18 +331,6 @@ const propTypes: Record<keyof HTMLTableProps, any> = {
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
});
2 changes: 1 addition & 1 deletion packages/table-plugin/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ export interface TableConfig {
*
* @defaultValue 1
*/
maxScale?: boolean;
maxScale?: number;

/**
* Container style.
Expand Down

0 comments on commit 6f27f5e

Please sign in to comment.