Skip to content

Commit 2ecc1e7

Browse files
authored
Merge pull request #122 from kohii/fix-error-while-ssr
Fix: using RichInput on SSR throws "navigator is not defined" error
2 parents 39295af + 5b51b6d commit 2ecc1e7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/dom.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ import { refKey } from "./utils";
44
* @internal
55
*/
66
export const isSafari = (): boolean => {
7+
if (typeof navigator === "undefined") {
8+
return false;
9+
}
710
const ua = navigator.userAgent.toLowerCase();
811
return ua.indexOf("safari") > -1 && ua.indexOf("chrome") <= -1;
912
};

0 commit comments

Comments
 (0)