From b7eb490adb277041d3d0800e61892837926a2987 Mon Sep 17 00:00:00 2001 From: Xander Deseyn Date: Wed, 3 Feb 2021 10:40:51 +0100 Subject: [PATCH] Add ChartHandle type --- src/Chart.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Chart.tsx b/src/Chart.tsx index c1582ea..7a492f7 100644 --- a/src/Chart.tsx +++ b/src/Chart.tsx @@ -33,8 +33,12 @@ type Props = { padding?: Padding } +export type ChartHandle = { + setTooltipIndex: (index: number | undefined) => void +} + const Chart: React.FC = React.memo( - React.forwardRef((props, ref) => { + React.forwardRef((props, ref) => { const { style, children, data = [], padding, xDomain, yDomain, viewport, disableGestures, disableTouch } = deepmerge(computeDefaultProps(props), props) const { dimensions, onLayout } = useComponentDimensions() const dataDimensions = calculateDataDimensions(dimensions, padding)