title: Flow type for specific React Native events?
body: <p>In order to flowtype events, I define custom types like the following:</p>
  
  <pre class="lang-js prettyprint-override"><code>export type OnScrollEvent = {
    nativeEvent: {
      contentOffset: {
        y: number
      },
      contentSize: {
        height: number
      }
    }
  }
  </code></pre>
  
  <p>Obviously, there are several missing properties (like <code>x</code> and <code>width</code>), but I have no need for them yet.</p>
  
  <p>I have tried to locate similar types for RN but only found an <code>Event</code> type that does not seem to be particularly useful:</p>
  
  <pre class="lang-js prettyprint-override"><code>import type {Event} from "react-native";
  
  handleEvent = (e: Event) =&gt; console.log(e.inexistentProperty)  // Flow doesn't care!
  </code></pre>
  
  <p>Are there any existing flow types for React Native events or do I have to keep defining them myself?</p>
  
  <h2>Update</h2>
  
  <p>They seem to be scattered around the code base. Here's the layout event type:</p>
  
  <pre class="lang-js prettyprint-override"><code>export type ViewLayout = {
    x: number,
    y: number,
    width: number,
    height: number,
  }
  
  export type ViewLayoutEvent = {
    nativeEvent: {
      layout: ViewLayout,
    }
  }
  </code></pre>
  
  <p>found in <a href="https://github.com/facebook/react-native/blob/26684cf3adf4094eb6c405d345a75bf8c7c0bf88/Libraries/Components/View/ViewPropTypes.js#L32-L43" rel="noreferrer">ViewPropTypes.js</a></p>