depsの比較は===
https://github.com/facebook/react/blob/ca143e18d83dcc57d7133d8859e0fc06df39b9f0/packages/shared/objectIs.js
https://qiita.com/seya/items/8291f53576097fc1c52a#usecallbackusememo-自体の処理コストを考える
code:ts
function is(x: any, y: any) {
return (
(x === y && (x !== 0 || 1 / x === 1 / y)) || (x !== x && y !== y)
);
}