Skip to content
This repository has been archived by the owner on Dec 10, 2021. It is now read-only.

Commit

Permalink
feat: forward ref from shell to superchart
Browse files Browse the repository at this point in the history
  • Loading branch information
kristw committed Jun 18, 2019
1 parent 8a15236 commit 8b5f9bb
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/superset-ui-chart/src/components/SuperChartShell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type ClassicProps = Omit<

export type Props = ClassicProps | SuperChartProps;

export default function SuperChartShell(props: Props) {
const SuperChartShell = React.forwardRef<SuperChart, Props>((props, ref) => {
if ('chartProps' in props) {
const { chartProps, ...rest } = props;

Expand All @@ -42,6 +42,7 @@ export default function SuperChartShell(props: Props) {

return (
<SuperChart
ref={ref}
{...rest}
annotationData={annotationData}
datasource={datasource}
Expand All @@ -58,5 +59,7 @@ export default function SuperChartShell(props: Props) {
);
}

return <SuperChart {...props} />;
}
return <SuperChart ref={ref} {...props} />;
});

export default SuperChartShell;

0 comments on commit 8b5f9bb

Please sign in to comment.