Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Refactor defaultProps to default parameters
  • Loading branch information
DanielKuhn committed Sep 4, 2024
commit cbba152f9cc3b666f11fc9ae962747b8c49dce97
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