Skip to content

Commit cb23e01

Browse files
committed
fix(table-plugin): default htmlAttribs would cause infinite re-renders
1 parent 100384d commit cb23e01

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

packages/table-plugin/src/HTMLTable.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
import React, { useMemo, useRef, useLayoutEffect, useCallback } from 'react';
1+
import React, {
2+
useMemo,
3+
useRef,
4+
useLayoutEffect,
5+
useCallback,
6+
ComponentType
7+
} from 'react';
28
import PropTypes from 'prop-types';
39
import {
410
Platform,
@@ -160,7 +166,7 @@ function useAnimatedAutoheight<WVP extends MinimalWebViewProps>({
160166
]
161167
);
162168
const oldContainerHeightRef = useRef<number | null>(containerHeight);
163-
const containerStyle = useMemo(
169+
const containerStyle: { height: any } = useMemo(
164170
() =>
165171
animationType === 'animated' && containerHeight !== null
166172
? {

packages/table-plugin/src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ export interface HTMLTableBaseProps extends HTMLTableStats {
330330
* Html attributes for this table node.
331331
*/
332332
htmlAttribs?: HtmlAttributesDictionary;
333+
333334
/**
334335
* The `WebView` Component you wish to use.
335336
*/

0 commit comments

Comments
 (0)