Skip to content

Commit

Permalink
fix(useGenerateId): improve useId conditional (#584)
Browse files Browse the repository at this point in the history
  • Loading branch information
danilowoz authored Sep 27, 2022
1 parent 5abfdda commit 91acb05
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sandpack-react/src/components/CodeEditor/useGeneratedId.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const useGeneratedId = (id?: string): string => {
return typeof id === "string"
? id
: // @ts-ignore
typeof React.useId === "function"
"useId" in React && typeof React.useId === "function"
? // @ts-ignore
React.useId()
: React.useRef<string>(generateRandomId()).current;
Expand Down

0 comments on commit 91acb05

Please sign in to comment.