diff --git a/src/__swaps__/screens/Swap/hooks/useWhyDidYouUpdate.ts b/src/hooks/useWhyDidYouUpdate.ts similarity index 87% rename from src/__swaps__/screens/Swap/hooks/useWhyDidYouUpdate.ts rename to src/hooks/useWhyDidYouUpdate.ts index 6748a16cd82..032e778e6ee 100644 --- a/src/__swaps__/screens/Swap/hooks/useWhyDidYouUpdate.ts +++ b/src/hooks/useWhyDidYouUpdate.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ import { useEffect, useRef } from 'react'; /** @@ -11,7 +12,7 @@ import { useEffect, useRef } from 'react'; * * @link https://usehooks.com/useWhyDidYouUpdate/ */ -export default function useWhyDidYouUpdate(name, props) { +export default function useWhyDidYouUpdate(name: string, props: Record) { // Get a mutable ref object where we can store props ... // ... for comparison next time this hook runs. const previousProps = useRef() as any; @@ -21,7 +22,7 @@ export default function useWhyDidYouUpdate(name, props) { // Get all keys from previous and current props const allKeys = Object.keys({ ...previousProps.current, ...props }); // Use this object to keep track of changed props - const changesObj = {}; + const changesObj: Record = {}; // Iterate through keys allKeys.forEach(key => { // If previous is different from current