Skip to content

Commit 6446f2c

Browse files
committed
feat: forceReactUseId
1 parent 2a5333e commit 6446f2c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/hooks/useId.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const useOriginId = getUseId();
4040

4141
export default useOriginId
4242
? // Use React `useId`
43-
function useId(id?: string) {
43+
function useId(id?: string, forceReactUseId?: boolean) {
4444
const reactId = useOriginId();
4545

4646
// Developer passed id is single source of truth
@@ -49,7 +49,7 @@ export default useOriginId
4949
}
5050

5151
// Test env always return mock id
52-
if (process.env.NODE_ENV === 'test') {
52+
if (!forceReactUseId && process.env.NODE_ENV === 'test') {
5353
return 'test-id';
5454
}
5555

0 commit comments

Comments
 (0)