title: Flow type for React element
body: <p>This is really document-less about use types in React or React Native. </p>
  
  <p>I found that an element type would be <code>React$Element&lt;any&gt;</code> in the <a href="https://github.com/facebook/flow/blob/v0.48.0/lib/react.js#L230" rel="nofollow noreferrer"><code>render()</code> function</a>. So I try this in my code:</p>
  
  <pre class="lang-js prettyprint-override"><code>// @flow
  import React from 'react';
  import { Text } from 'react-native';
  
  function greetingTextNode(string: string): React$Element&lt;any&gt; {
    return (
      &lt;Text&gt;Greeting, { string }.&lt;/Text&gt;
    )
  }
  </code></pre>
  
  <p>but it shows a flowtype error in console:</p>
  
  <pre><code> 20:     &lt;Text&gt;Greeting, { string }.&lt;/Text&gt;
           ^^^^^^ Text. This type is incompatible with
   97: type _ReactClass&lt;DefaultProps, Props, Config: $Diff&lt;Props, DefaultProps&gt;, C: React$Component&lt;DefaultProps, Props, any&gt;&gt; = Class&lt;C&gt;;
                                                                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ React$Component. See lib: /private/tmp/flow/flowlib_243350bf/react.js:97
  </code></pre>
  
  <p>How can I correct the flow type for a react element?</p>