cullAttributes() Method Mutates Props Directly
Closed this issue · 0 comments
giorgosart commented
In the EasyEdit component, the cullAttributes() function directly mutates the attributes object from props:
cullAttributes() {
const { attributes } = this.props;
delete attributes["type"];
delete attributes["onChange"];
delete attributes["value"];
}
Props should be treated as immutable in React, and mutating them directly can cause unexpected side effects, especially when attributes are passed by reference or reused.