We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b283d75 commit 035e4cfCopy full SHA for 035e4cf
packages/react-dom/src/events/checkPassiveEvents.js
@@ -16,11 +16,13 @@ export let passiveBrowserEventsSupported = false;
16
// https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support
17
if (enableEventAPI && canUseDOM) {
18
try {
19
- const options = {
20
- get passive() {
+ const options = {};
+ // $FlowFixMe: Ignore Flow complaining about needing a value
21
+ Object.defineProperty(options, 'passive', {
22
+ get: function() {
23
passiveBrowserEventsSupported = true;
24
},
- };
25
+ });
26
window.addEventListener('test', options, options);
27
window.removeEventListener('test', options, options);
28
} catch (e) {
0 commit comments