Skip to content

Commit d147e7b

Browse files
committed
Another attempt
1 parent 558983d commit d147e7b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/core-react.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,11 @@ export function useForceUpdate() {
120120

121121
export function useUniqueId() {
122122
if (SSR_SUPPORT_ENABLED) {
123-
if (React.version.startsWith("18")) {
123+
if (React.version.startsWith("18") && typeof (React as any)["useId"] !== "undefined") {
124124
return `s${(React as any)["useId"]().replace(/\:/g, "")}`;
125125
}
126126

127-
if ((React as any)["unstable_useOpaqueIdentifier"]) {
127+
if (typeof (React as any)["unstable_useOpaqueIdentifier"] !== "undefined") {
128128
return `s${(React as any)["unstable_useOpaqueIdentifier"]().replace(/\:/g, "")}`;
129129
}
130130
}

0 commit comments

Comments
 (0)