Skip to content

Commit

Permalink
docs: add clearer warning and recommendation for useId (#1725)
Browse files Browse the repository at this point in the history
  • Loading branch information
booc0mtaco authored Aug 16, 2023
1 parent c935b4f commit 6904e29
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/util/useId.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const useId =
function useId() {
if (process.env.NODE_ENV !== 'production' && showWarning) {
console.warn(
'EDS useId is not ssr friendly if using React <18 as it uses the native React.useId hook if available https://react.dev/reference/react/useId.',
"React < 18: EDS's `useId` is not SSR friendly and can lead to race conditions. We recommend importing `uniqueId` and setting the id prop directly, or using React 18's built-in `React.useId` https://react.dev/reference/react/useId",
);
showWarning = false;
}
Expand Down

0 comments on commit 6904e29

Please sign in to comment.