From d071c73756590cec1fef3ed7fa60347102ed44bf Mon Sep 17 00:00:00 2001 From: Xevion Date: Fri, 10 May 2024 01:37:14 -0500 Subject: [PATCH] Switch registryDataRef initial value type to match ref type No fucking clue why I used a non-matching type for this; makes no sense --- src/hooks/useLookup.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/hooks/useLookup.tsx b/src/hooks/useLookup.tsx index a0749fc..9499013 100644 --- a/src/hooks/useLookup.tsx +++ b/src/hooks/useLookup.tsx @@ -25,9 +25,14 @@ import { Maybe, Result } from "true-myth"; export type WarningHandler = (warning: { message: string }) => void; const useLookup = (warningHandler?: WarningHandler) => { + /** + * A reference to the registry data, which is used to cache the registry data in memory. + * This uses TargetType as the key, meaning v4/v6 IP/CIDR lookups are differentiated. + */ const registryDataRef = useRef>( - {} as Record + {} as Record ); + const [error, setError] = useState(null); const [target, setTarget] = useState(""); // Used by a callback on LookupInput to forcibly set the type of the lookup.