From 207292a367f1bc24201400d695ac2cd655e6ecbd Mon Sep 17 00:00:00 2001 From: Deep Joy Majumdar Date: Thu, 26 Sep 2024 17:09:13 -0700 Subject: [PATCH] Use obfusctaed reference to React.useId (#2797) --- packages/react/id/src/id.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react/id/src/id.tsx b/packages/react/id/src/id.tsx index 02b2eaa74..ef45df83f 100644 --- a/packages/react/id/src/id.tsx +++ b/packages/react/id/src/id.tsx @@ -1,8 +1,8 @@ import * as React from 'react'; import { useLayoutEffect } from '@radix-ui/react-use-layout-effect'; -// We `toString()` to prevent bundlers from trying to `import { useId } from 'react';` -const useReactId = (React as any)['useId'.toString()] || (() => undefined); +// We spaces with `.trim().toString()` to prevent bundlers from trying to `import { useId } from 'react';` +const useReactId = (React as any)[' useId '.trim().toString()] || (() => undefined); let count = 0; function useId(deterministicId?: string): string {