Skip to content

Commit 72d6f97

Browse files
committed
fix: ts error
1 parent a0f0b4f commit 72d6f97

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

app/components/artifact.tsx

+5-7
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,12 @@ export function HTMLPreview(props: {
4848
}, []);
4949

5050
const height = useMemo(() => {
51-
const parentHeight = props.height || 600;
52-
if (props.autoHeight !== false) {
53-
return iframeHeight + 40 > parentHeight
54-
? parentHeight
55-
: iframeHeight + 40;
56-
} else {
57-
return parentHeight;
51+
if (!props.autoHeight) return props.height || 600;
52+
if (typeof props.height === "string") {
53+
return props.height;
5854
}
55+
const parentHeight = props.height || 600;
56+
return iframeHeight + 40 > parentHeight ? parentHeight : iframeHeight + 40;
5957
}, [props.autoHeight, props.height, iframeHeight]);
6058

6159
const srcDoc = useMemo(() => {

0 commit comments

Comments
 (0)