diff --git a/packages/react/id/src/id.tsx b/packages/react/id/src/id.tsx index 02b2eaa74b..ef45df83f5 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 {