2024-04-05 13:16:49 +02:00
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
2020-11-12 21:13:28 +02:00
|
|
|
export default function propsHaveChanged(previous: any, next: any): boolean {
|
2020-10-09 19:35:46 +02:00
|
|
|
if (!previous && next) return true;
|
2020-10-18 22:52:10 +02:00
|
|
|
if (previous && !next) return true;
|
|
|
|
if (!previous && !next) return false;
|
2020-10-09 19:35:46 +02: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;
|
|
|
|
}
|