2024-04-05 12:16:49 +01:00
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
2020-11-12 19:13:28 +00:00
|
|
|
export default function propsHaveChanged(previous: any, next: any): boolean {
|
2020-10-09 18:35:46 +01:00
|
|
|
if (!previous && next) return true;
|
2020-10-18 21:52:10 +01:00
|
|
|
if (previous && !next) return true;
|
|
|
|
if (!previous && !next) return false;
|
2020-10-09 18:35:46 +01:00
|
|
|
|
|
|
|
if (Object.keys(previous).length !== Object.keys(next).length) return true;
|
|
|
|
|
|
|
|
for (const n in previous) {
|
|
|
|
if (previous[n] !== next[n]) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|