Skip to content

Commit

Permalink
fix: Indicator onLoad invocation fixes (#34)
Browse files Browse the repository at this point in the history
fix Indicator onLoad invocation
  • Loading branch information
korvin89 authored Jul 28, 2022
1 parent bdaa478 commit 95fafc3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/plugins/indicator/renderer/IndicatorWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ const IndicatorWidget = React.forwardRef<ChartKitWidgetRef | undefined, Indicato
data: {data = [], defaultColor},
} = props;

React.useEffect(() => {
React.useLayoutEffect(() => {
// TODO: swap to onRender after https://github.com/yandex-cloud/chartkit/issues/33
onLoad?.();
}, []);
});

if (isEmpty(data)) {
throw new ChartKitError({
Expand Down

0 comments on commit 95fafc3

Please sign in to comment.