Skip to content

Commit cca3c68

Browse files
authored
stop throw without ctx (#740)
1 parent ebe6471 commit cca3c68

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hooks/useDevice.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ export const useDevice = (): Device => {
1717
}
1818

1919
if (!ctx) {
20-
throw new Error("Missing context in rendering tree");
20+
console.warn("Missing context in rendering tree")
2121
}
2222

23-
return ctx.device;
23+
return ctx?.device || "desktop";
2424
};

0 commit comments

Comments
 (0)