Skip to content

Commit 3221ac9

Browse files
authored
Merge pull request #4188 from VisActor/fix/fix-type-error-of-react-vchart
Fix/fix type error of react vchart
2 parents 72ae032 + 8b45a2c commit 3221ac9

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"comment": "fix: fix the issue of className miss in react-vchart\n\n",
5+
"type": "none",
6+
"packageName": "@visactor/vchart"
7+
}
8+
],
9+
"packageName": "@visactor/vchart",
10+
"email": "lixuef1313@163.com"
11+
}

packages/react-vchart/src/charts/BaseChart.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ export interface BaseChartProps
4343
DimensionEventProps,
4444
HierarchyEventProps,
4545
ChartLifeCycleEventProps,
46-
IReactTooltipProps {
46+
IReactTooltipProps,
47+
ContainerProps {
4748
vchartConstructor?: IVChartConstructor;
4849
/** @deprecated 请使用 vchartConstructor */
4950
vchartConstrouctor?: IVChartConstructor;

packages/react-vchart/src/containers/withContainer.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
import type { StringOrNumber } from '@visactor/vchart';
12
import React, { useRef, useState, useLayoutEffect } from 'react';
23

34
export interface ContainerProps {
45
style?: React.CSSProperties;
56
className?: string;
67
width?: number | string;
78
height?: number | string;
8-
id?: string;
9+
id?: StringOrNumber;
910
}
1011

1112
export default function withContainer<P extends ContainerProps>(
@@ -25,7 +26,7 @@ export default function withContainer<P extends ContainerProps>(
2526
return (
2627
<div
2728
ref={container}
28-
id={id}
29+
id={id?.toString()}
2930
className={className}
3031
style={{
3132
position: 'relative',

0 commit comments

Comments
 (0)