Skip to content

Commit

Permalink
Add ChartHandle type
Browse files Browse the repository at this point in the history
  • Loading branch information
xanderdeseyn committed Feb 3, 2021
1 parent 48a1b1f commit b7eb490
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@ type Props = {
padding?: Padding
}

export type ChartHandle = {
setTooltipIndex: (index: number | undefined) => void
}

const Chart: React.FC<Props> = React.memo(
React.forwardRef((props, ref) => {
React.forwardRef<ChartHandle, Props>((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)
Expand Down

0 comments on commit b7eb490

Please sign in to comment.