@pushwoosh/kit-charts 0.4.1 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -158,11 +158,13 @@ function ChartBody({
158
158
  const identity = seriesIdentity(options);
159
159
  // A different set of series is a different chart: start from its own options
160
160
  // again rather than carrying the previous chart's switched-off indices over.
161
- useEffect(() => {
161
+ const identityDeps = [identity];
162
+ const [prevIdentityDeps, setPrevIdentityDeps] = useState(null);
163
+ if (prevIdentityDeps === null || identityDeps.some((dep, index) => dep !== prevIdentityDeps[index])) {
164
+ setPrevIdentityDeps(identityDeps);
162
165
  setHidden(hiddenByOptions(options));
163
166
  setZoom(null);
164
- // eslint-disable-next-line react-hooks/exhaustive-deps
165
- }, [identity]);
167
+ }
166
168
  const toggle = useCallback(item => {
167
169
  // A tooltip captured before the toggle would keep quoting what just went away.
168
170
  setHover(null);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/kit-charts",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "Small React chart library on SVG, with a Highcharts-shaped configuration model",
5
5
  "license": "MIT",
6
6
  "repository": {