title: react passive event handler for a scroll
body: <p>I have a event handler for a scroll in my react and I am trying to make it passive. But it isn't working, I keep getting this warning in my console:</p>
  <blockquote>
  <p>Consider marking event handler as 'passive' to make the page more
  responive.</p>
  </blockquote>
  <p>So here is where I read the event:</p>
  <pre><code>bindEventListeners()
  {
      EventContainer.readWindowEvent('scroll', this.onScroll);
  }
  </code></pre>
  <p>Here is my <code>readWindowEvent</code> function in my EventContainer.js file:</p>
  <pre><code>static readWindowEvent(slug, callback, passive = true)
      {
          let result = null;
  
          let allowed = this.getAllowedWindowEventListeners().indexOf(slug) != -1;
  
          if (!allowed) {
              result = console.error(
                  'You cannot register ' + slug + ' on the window. Allowed events: ' +
                  this.getAllowedWindowEventListeners().join(', ')
              )
          }
  
          if (allowed) {
              result = window.addEventListener(
                  slug,
                  callback,
                  {passive: passive}
              );
          }
  
          return result;
      }
  </code></pre>
  <p>On this line:</p>
  <blockquote>
  <p>{passive: passive}</p>
  </blockquote>
  <p>I get the following error in my editor:</p>
  <blockquote>
  <p>Argument type {passive: boolean} is not assignable to parameter type boolean</p>
  </blockquote>
  <p>Anyone knows what I am doing wrong here?</p>
  <p>Any help is appreciated!</p>