Skip to content

Commit 8a35991

Browse files
committed
refactor: update useSSRSafeId to utilize useId from React
- Replaced the import of React's useId with a direct import from 'react' in the useSSRSafeId helper. - This change simplifies the code and ensures compatibility with the latest React features.
1 parent aaa45c2 commit 8a35991

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

packages/react-core/src/helpers/useSSRSafeId.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { useState } from 'react';
1+
import { useId, useState } from 'react';
22

3-
const react = require('react');
4-
const reactUseId: (() => string) | undefined = typeof react.useId === 'function' ? react.useId : undefined;
3+
const reactUseId: (() => string) | undefined = typeof useId === 'function' ? useId : undefined;
54

65
let counter = 0;
76

0 commit comments

Comments
 (0)