Created
April 10, 2019 11:05
-
-
Save maxkoretskyi/123e35b0b91c07da63a8536e80bb6aa2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class AgGridReact extends React.Component { | |
componentWillReceiveProps(nextProps: any) { | |
const changes = <any>{}; | |
const changedKeys = Object.keys(nextProps); | |
changedKeys.forEach((propKey) => { | |
... | |
if (!this.areEquivalent(this.props[propKey], nextProps[propKey])) { | |
changes[propKey] = { | |
previousValue: this.props[propKey], | |
currentValue: nextProps[propKey] | |
}; | |
} | |
}); | |
AgGrid.ComponentUtil.getEventCallbacks().forEach((funcName: string) => { | |
if (this.props[funcName] !== nextProps[funcName]) { | |
changes[funcName] = { | |
previousValue: this.props[funcName], | |
currentValue: nextProps[funcName] | |
}; | |
} | |
}); | |
AgGrid.ComponentUtil.processOnChange(changes, this.gridOptions, this.api, this.columnApi); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment