We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ad9a6df commit 0f7cc2bCopy full SHA for 0f7cc2b
packages/react-events/src/Press.js
@@ -101,7 +101,10 @@ type PressEvent = {|
101
shiftKey: boolean,
102
|};
103
104
-const isMac = /^Mac/.test(navigator.platform);
+const isMac =
105
+ typeof window !== 'undefined' && window.navigator != null
106
+ ? /^Mac/.test(window.navigator.platform)
107
+ : false;
108
const DEFAULT_PRESS_END_DELAY_MS = 0;
109
const DEFAULT_PRESS_START_DELAY_MS = 0;
110
const DEFAULT_LONG_PRESS_DELAY_MS = 500;
0 commit comments