From 1ee43e86d6d4be9b15593202e75e688d84a525e8 Mon Sep 17 00:00:00 2001 From: AAGaming Date: Sat, 3 Aug 2024 13:50:33 -0400 Subject: [PATCH] chore(utils/react): get rid of ts-expect-error --- src/utils/react/react.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/utils/react/react.ts b/src/utils/react/react.ts index 81284f4..8a4a04e 100644 --- a/src/utils/react/react.ts +++ b/src/utils/react/react.ts @@ -104,19 +104,15 @@ export function wrapReactClass(node: any, prop: any = 'type') { export function getReactRoot(o: HTMLElement | Element | Node) { return ( - // @ts-expect-error 7053 - o[Object.keys(o).find((k) => k.startsWith('__reactContainer$')) as string] || - // @ts-expect-error 7053 - o['_reactRootContainer']?._internalRoot?.current + (o as any)[Object.keys(o).find((k) => k.startsWith('__reactContainer$')) as string] || + (o as any)['_reactRootContainer']?._internalRoot?.current ); } export function getReactInstance(o: HTMLElement | Element | Node) { return ( - // @ts-expect-error 7053 - o[Object.keys(o).find((k) => k.startsWith('__reactFiber')) as string] || - // @ts-expect-error 7053 - o[Object.keys(o).find((k) => k.startsWith('__reactInternalInstance')) as string] + (o as any)[Object.keys(o).find((k) => k.startsWith('__reactFiber')) as string] || + (o as any)[Object.keys(o).find((k) => k.startsWith('__reactInternalInstance')) as string] ); }