mirror of
https://github.com/dergigi/boris.git
synced 2026-02-16 04:24:25 +01:00
The root cause was scheduleSave being in the scroll effect's dependency array. Even though scheduleSave had an empty dependency array, React still saw it as a dependency and re-ran the effect constantly, causing unmount/remount loops and triggering flush-on-unmount repeatedly. Solution: Store scheduleSave in a ref (scheduleSaveRef) and call it via the ref in the scroll handler. This removes scheduleSave from the effect dependencies while still allowing the scroll handler to access the latest version. This fixes the "Maximum update depth exceeded" error and stops the spam saves.