diff --git a/.github/workflows/release-v4-2.yml b/.github/workflows/release-v4-2.yml index a1087ff6..3fde57e5 100644 --- a/.github/workflows/release-v4-2.yml +++ b/.github/workflows/release-v4-2.yml @@ -15,5 +15,3 @@ jobs: node-version: 18 default-branch: v4-2 npm-dist-tag: untagged - skip-github-release: true - skip-labeling: true diff --git a/src/plugins/d3/renderer/components/Chart.tsx b/src/plugins/d3/renderer/components/Chart.tsx index e85acabd..6a2a4ed2 100644 --- a/src/plugins/d3/renderer/components/Chart.tsx +++ b/src/plugins/d3/renderer/components/Chart.tsx @@ -93,15 +93,17 @@ export const Chart = (props: Props) => { yScale, svgContainer: svgRef.current, }); + + const clickHandler = data.chart?.events?.click; React.useEffect(() => { - if (data.chart?.events?.click) { - dispatcher.on('click-chart', data.chart?.events?.click); + if (clickHandler) { + dispatcher.on('click-chart', clickHandler); } return () => { dispatcher.on('click-chart', null); }; - }, [dispatcher]); + }, [dispatcher, clickHandler]); const boundsOffsetTop = chart.margin.top; const boundsOffsetLeft = chart.margin.left + getWidthOccupiedByYAxis({preparedAxis: yAxis});