[PR #6554] Fix/stacked bar graph crash 6406 #6597

Closed
opened 2026-02-28 21:30:29 -06:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/actualbudget/actual/pull/6554

State: closed
Merged: Yes


Fix: Remove responsive prop from StackedBarGraph to prevent infinite loop

Fixes #6406

Problem

The StackedBarGraph component was crashing with React Error #185 (Maximum update depth exceeded) when displaying reports with:

  • Mode: Time
  • Split: Category
  • Type: Net
  • Interval: Monthly
  • Live date range: Year to date
  • 6+ months of data

Root Cause

The responsive prop on recharts' BarChart was conflicting with explicit width and height props provided by the Container's AutoSizer, causing recharts' useElementOffset hook to trigger an infinite re-render loop.

Solution

Removed the redundant responsive prop since explicit dimensions are already provided by the Container component through AutoSizer.

Testing Steps

  1. Create a custom report with the configuration above
  2. Add at least 6-7 months of transaction data across multiple categories
  3. Switch to Stacked Bar Graph view
  4. Verify the graph renders without crashing

Notes

  • Tested with the Netlify preview deployment
  • Other graph components (BarGraph, LineGraph, etc.) have the same pattern and may need similar fixes.

Testing Results

Tested the fix successfully with Netlify preview:

Configuration used:

  • Mode: Time
  • Split: Category
  • Type: Net
  • Interval: Monthly
  • Range: Year to date
  • Data: 7+ months with multiple categories

Result:
Stacked Bar Graph renders correctly without crashing
No React Error #185 (Maximum update depth exceeded)
All interactions work properly (tooltips, hover effects)

The removal of the responsive prop fixed the infinite loop issue caused by the conflict between AutoSizer and recharts' useElementOffset hook.

Screenshot 2026-01-05 at 13 54 17
**Original Pull Request:** https://github.com/actualbudget/actual/pull/6554 **State:** closed **Merged:** Yes --- ## Fix: Remove responsive prop from StackedBarGraph to prevent infinite loop Fixes #6406 ### Problem The StackedBarGraph component was crashing with React Error #185 (Maximum update depth exceeded) when displaying reports with: - Mode: Time - Split: Category - Type: Net - Interval: Monthly - Live date range: Year to date - 6+ months of data ### Root Cause The `responsive` prop on recharts' BarChart was conflicting with explicit `width` and `height` props provided by the Container's AutoSizer, causing recharts' `useElementOffset` hook to trigger an infinite re-render loop. ### Solution Removed the redundant `responsive` prop since explicit dimensions are already provided by the Container component through AutoSizer. ### Testing Steps 1. Create a custom report with the configuration above 2. Add at least 6-7 months of transaction data across multiple categories 3. Switch to Stacked Bar Graph view 4. Verify the graph renders without crashing ### Notes - Tested with the Netlify preview deployment - Other graph components (BarGraph, LineGraph, etc.) have the same pattern and may need similar fixes. ### Testing Results ✅ Tested the fix successfully with Netlify preview: **Configuration used:** - Mode: Time - Split: Category - Type: Net - Interval: Monthly - Range: Year to date - Data: 7+ months with multiple categories **Result:** ✅ Stacked Bar Graph renders correctly without crashing ✅ No React Error #185 (Maximum update depth exceeded) ✅ All interactions work properly (tooltips, hover effects) The removal of the `responsive` prop fixed the infinite loop issue caused by the conflict between AutoSizer and recharts' useElementOffset hook. <img width="2285" height="1060" alt="Screenshot 2026-01-05 at 13 54 17" src="https://github.com/user-attachments/assets/88a29835-241f-45e2-9250-4f64bf6e1514" />
GiteaMirror added the pull-request label 2026-02-28 21:30:29 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#6597