Skip to content

Commit 0c4826a

Browse files
authored
fix(DnD): dragAndDrop EventWrapper.js error: cannot add property 'X', object is not extensible
* Fix dragAndDrop EventWrapper.js error: cannot add property 'X', object is not extensible Fix for error: cannot add property 'X', object is not extensible An error appears when trying to modify this.props. The solution is to create a copy of the props using JSON.parse() and JSON.stringify() https://stackoverflow.com/questions/55567386/react-cannot-add-property-x-object-is-not-extensible * Update EventWrapper.js --------- Co-authored-by: martinvu-dev <[email protected]>
1 parent 0bd5044 commit 0c4826a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/addons/dragAndDrop/EventWrapper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class EventWrapper extends React.Component {
4747
.getAttribute('class')
4848
?.includes('rbc-addons-dnd-resize')
4949
if (!isResizeHandle) {
50-
let extendedEvent = this.props.event
50+
let extendedEvent = {...this.props.event}
5151
extendedEvent.sourceResource = this.props.resource
5252
this.context.draggable.onBeginAction(this.props.event, 'move')
5353
}

0 commit comments

Comments
 (0)