title: How to use forwardRef with FunctionComponent in React Native using TypeScript
body: <p>I've looked at many of the docs and examples but I still can't seem to quite understand how to use <code>forwardRef</code> with a functional component with TypeScript in React Native. Below is an example where I create a <code>MyCustomComponent</code> with a custom function that I try to call from the parent by creating a ref. However, since the ref is incorrectly defined and <code>null</code>, I obviously get an error message telling me that the function doesn't exist. Please help me understand how to properly use <code>forwardRef</code> in React Native. Thanks in advance!</p>
  <pre><code>interface MyCustomComponentProps {
    title: string
  }
  
  const MyCustomComponent: React.FunctionComponent&lt;MyCustomComponentProps&gt; = React.forwardRef((props, ref) =&gt; {
    const coolAlert = () =&gt; {
      Alert.alert('Hey!', 'This was called from MyCustomComponent')
    }
    return (
      &lt;View&gt;
        &lt;Text&gt;{props.title}&lt;/Text&gt;
      &lt;/View&gt;
    )
  })
  
  export default function App () {
    const MyCustomComponentRef = useRef()
    return (
      &lt;SafeAreaView&gt;
        &lt;MyCustomComponent ref={MyCustomComponentRef} title='Hello World' /&gt;
        &lt;TouchableOpacity
          onPress={() =&gt; {
            MyCustomComponentRef.coolAlert()
          }}&gt;
          &lt;Text&gt;Click Me&lt;/Text&gt;
        &lt;/TouchableOpacity&gt;
      &lt;/SafeAreaView&gt;
    )
  }
  </code></pre>