/** * Copied from https://github.com/facebook/fbjs/blob/master/packages/fbjs/src/core/shallowEqual.js * Original code is Copyright (c) 2013-present, Facebook, Inc. Licensed as MIT. */ /** * Check if two values are equal by comparing them shallowly (instead of doing deep compare). * React `PureComponent` and `React.memo` use this logic to compare `props` and `state`. * @param {any} arg1 First argument * @param {any} arg2 Second argument * @returns {boolean} true if both arguments are shallowly equal; otherwise false. * @example * shouldComponentUpdate(nextProps, nextState){ * // If `saved` is true, don't re-render. Else, only re-render if props or state are changed. * if (saved) { * return false; * } * return !shallowEqual(nextProps, this.props) || !shallowEqual(nextState, this.state); * } */ export default function shallowEqual(arg1: any, arg2: any): boolean;