Skip to content

Instantly share code, notes, and snippets.

Sivcan Singh sivcan

Block or report user

Report or block sivcan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@sivcan
sivcan / NextPropsDiff.js
Created Mar 7, 2018
React utility for nextProps diff (Shallow check)
View NextPropsDiff.js
// Use it with the componentWillReceiveProps lifecycle method
//
// componentWillReceiveProps(nextProps) {
// shallowEqual(this.props, nextProps);
// }
//
function shallowEqual(objA, objB) {
if (is(objA, objB)) return true
You can’t perform that action at this time.