Skip to content

Commit fbf7b2b

Browse files
committed
chore: incredible review feedback
1 parent cd6dc93 commit fbf7b2b

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

packages/react-form/src/useId.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,4 @@ import { version as reactVersion, useId as useReactId } from 'react'
22
import { uuid } from '@tanstack/form-core'
33

44
/** React 17 does not have the useId hook, so we use a random uuid as a fallback. */
5-
export function useId() {
6-
if (reactVersion.split('.')[0] === '17') {
7-
return uuid()
8-
}
9-
10-
// react-compiler/react-compiler is disabled because useId is not available in React 17. However in React 18+ it is available and we want to use it.
11-
// eslint-disable-next-line react-compiler/react-compiler, react-hooks/rules-of-hooks
12-
return useReactId()
13-
}
5+
export const useFormId = reactVersion.split('.')[0] === '17' ? uuid : useReactId

0 commit comments

Comments
 (0)