mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
React Events: check window before using navigator (#15768)
This commit is contained in:
committed by
GitHub
parent
ad9a6df58c
commit
0f7cc2ba84
Vendored
+4
-1
@@ -101,7 +101,10 @@ type PressEvent = {|
|
||||
shiftKey: boolean,
|
||||
|};
|
||||
|
||||
const isMac = /^Mac/.test(navigator.platform);
|
||||
const isMac =
|
||||
typeof window !== 'undefined' && window.navigator != null
|
||||
? /^Mac/.test(window.navigator.platform)
|
||||
: false;
|
||||
const DEFAULT_PRESS_END_DELAY_MS = 0;
|
||||
const DEFAULT_PRESS_START_DELAY_MS = 0;
|
||||
const DEFAULT_LONG_PRESS_DELAY_MS = 500;
|
||||
|
||||
Reference in New Issue
Block a user