Skip to content

Commit 3ae13c2

Browse files
8: reserve space on ssr
1 parent cb1d24b commit 3ae13c2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/lib/src/components/chart.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,14 @@ export const Chart = memo(forwardRef(function Chart(props: ChartProps, ref: Forw
4343
[containerRef]
4444
);
4545

46+
const style = {
47+
height: !props.autoSize && props.height !== undefined ? props.height + 'px' : undefined,
48+
width: !props.autoSize && props.width !== undefined ? props.width + 'px' : undefined,
49+
...container.style,
50+
}
51+
4652
return (
47-
<div ref={handleContainerRef} {...restContainer}>
53+
<div ref={handleContainerRef} {...restContainer} style={style}>
4854
{element !== null ? <ChartComponent {...rest} ref={ref} container={element}/> : null}
4955
</div>
5056
)

0 commit comments

Comments
 (0)