diff --git a/packages/react/presence/src/Presence.tsx b/packages/react/presence/src/Presence.tsx index e9da5615c9..51066bd8a0 100644 --- a/packages/react/presence/src/Presence.tsx +++ b/packages/react/presence/src/Presence.tsx @@ -153,7 +153,12 @@ function usePresence(present: boolean) { return { isPresent: ['mounted', 'unmountSuspended'].includes(state), ref: React.useCallback((node: HTMLElement) => { - if (node) stylesRef.current = getComputedStyle(node); + if (node) { + stylesRef.current = getComputedStyle(node); + } + else { + stylesRef.current = {} as any; + } setNode(node); }, []), };