diff --git a/src/utils/helper.ts b/src/utils/helper.ts index f7a95dd02d..6ae4eb6e44 100644 --- a/src/utils/helper.ts +++ b/src/utils/helper.ts @@ -1,4 +1,4 @@ -import { version } from 'react' +import React from 'react' export const noop = () => {} // Using noop() as the undefined value as undefined can possibly be replaced @@ -6,7 +6,9 @@ export const noop = () => {} // to ensure that tsc doesn't remove the __NOINLINE__ comment. // prettier-ignore export const UNDEFINED = (/*#__NOINLINE__*/ noop()) as undefined -export const IS_REACT_LEGACY = !version.startsWith('18') + +// @ts-expect-error TODO: should remove this when the default react version is 18 +export const IS_REACT_LEGACY = !React.useId export const OBJECT = Object export const isUndefined = (v: any): v is undefined => v === UNDEFINED