The current shallowCompare implementation doesn't work if the objects have different keys
You can try shallowCompare with the following code :
console.log(shallowCompare({ a: 1, b: 1 }, { a: 1 }));
console.log(shallowCompare({ a: 1 }, { a: 1, b: 1 }));
shallowCompare({ a: 1, b: 1 }, { a: 1 }) => true
This is because we only iterate on the keys of nextProps, ignoring any extra props in prevProps.