onLayoutChange is always called twice

Author: akteiglandCreated Nov 20, 2023Updated Aug 4, 2026
Labelsbugready-for-human

Describe the bug

After updating to v1.4.1, onLayoutChange is always called twice.

My same code works on v1.4.0, but on v1.4.1 my function onLayoutChange is always called twice, first with the correct changes and then again with a revert. This happens both on dragging and resizing.

You can see this happens in the default code sandbox if you change the version to 1.4.1

Your Example Website or App

https://codesandbox.io/s/frosty-stallman-8763h3?file=/src/index.js

Steps to Reproduce the Bug or Issue

Add "onLayoutChange" prop Change the layout See the function is called twice

Expected behavior

As a user, I expect onLayoutChange to only be called once per change

react-grid-layout library version

1.4.1

Operating System Version

Linux

Browser

Firefox

Additional context

No response

Screenshots or Videos

No response

Source: react-grid-layout/react-grid-layout