React documentation states that
shallowCompare returns true if the shallow comparison for props or state fails and therefore the component should update.
So, if is understand correctly, if there is no state in my component and i know there are no changes in the props keys, this code
let shallowDiff = Object.keys(this.props).filter((item) => {
return this.props[item] !== nextProps[item];
});
return shallowDiff.length !== 0;
should return the same as the react comparison. But it doesn't. If there are no changes, my code correctly returns an empty array, whereas react returns true. I am trying to understand this behavior and searching a way to search the problem-key, but i just do not get it.