Skip to content

Commit b24adac

Browse files
committed
Fix stale data on <ResponsiveReactGridLayout> onLayoutChange callback
1 parent c407ad8 commit b24adac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/ResponsiveReactGridLayout.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export default class ResponsiveReactGridLayout extends React.Component {
116116

117117
// wrap layouts so we do not need to pass layouts to child
118118
onLayoutChange = (layout) => {
119-
this.props.onLayoutChange(layout, this.props.layouts);
119+
this.props.onLayoutChange(layout, {...this.props.layouts, [this.state.breakpoint]: this.state.layout});
120120
};
121121
onLayoutChange: (layout: Layout) => void;
122122

0 commit comments

Comments
 (0)