Skip to content

Commit

Permalink
fix: Wait a tick before reporting render status (#2131)
Browse files Browse the repository at this point in the history
wait a tick before reporting render status
  • Loading branch information
drewdaemon authored Aug 3, 2023
1 parent d55d406 commit fd2bca4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/charts/src/components/chart_status.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ class ChartStatusComponent extends React.Component<ChartStatusStateProps> {
}

dispatchRenderChange = () => {
this.props.onRenderChange?.(this.props.rendered);
const { onRenderChange, rendered } = this.props;
if (onRenderChange) {
window.requestAnimationFrame(() => {
onRenderChange(rendered);
});
}
};

render() {
Expand Down

0 comments on commit fd2bca4

Please sign in to comment.