Skip to content

Commit cbba152

Browse files
committed
Refactor defaultProps to default parameters
1 parent 26870f7 commit cbba152

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

packages/table-plugin/src/HTMLTable.tsx

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -259,15 +259,15 @@ export const HTMLTable = function HTMLTable({
259259
cssRules,
260260
html,
261261
sourceBaseUrl,
262-
animationType,
262+
animationType = 'animated',
263263
computeHeuristicContentHeight = defaultComputeHeuristicContentHeight,
264264
computeContainerHeight = defaultComputeContainerHeight,
265265
webViewProps: userWebViewProps,
266266
style,
267267
onLinkPress,
268-
animationDuration,
268+
animationDuration = DEFAULT_TRANSITION_DURATION,
269269
htmlAttribs,
270-
maxScale,
270+
maxScale = 1,
271271
...stats
272272
}: HTMLTableProps) {
273273
const onDOMLinkPress = useCallback(
@@ -331,18 +331,6 @@ const propTypes: Record<keyof HTMLTableProps, any> = {
331331
displayMode: PropTypes.oneOf(['flex', 'expand'])
332332
};
333333

334-
const defaultProps = {
335-
animationDuration: DEFAULT_TRANSITION_DURATION,
336-
animationType: 'animated',
337-
computeHeuristicContentHeight: defaultComputeHeuristicContentHeight,
338-
computeContainerHeight: defaultComputeContainerHeight,
339-
maxScale: 1
340-
};
341-
342334
Object.defineProperty(HTMLTable, 'propTypes', {
343335
value: propTypes
344336
});
345-
346-
Object.defineProperty(HTMLTable, 'defaultProps', {
347-
value: defaultProps
348-
});

packages/table-plugin/src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ export interface TableConfig {
234234
*
235235
* @defaultValue 1
236236
*/
237-
maxScale?: boolean;
237+
maxScale?: number;
238238

239239
/**
240240
* Container style.

0 commit comments

Comments
 (0)