title: How to use ref in a functional component (expo camera)
body: <p>I'm reacting my camera as a functional component but the documentation says</p>
  <blockquote>
  <p>To use methods that Camera exposes one has to create a component <code>ref</code>
  and invoke them using it.</p>
  </blockquote>
  <p>but in react documentation it says that I can not use <code>ref</code> in a functional component.</p>
  <p>if this the same thing as <code>useRef</code>? I'm trying to get the camera to take a picture and save it to my phones memory.</p>
  <pre><code>    &lt;Camera
      style={{ flex: 1 }}
      type={type}
      useCamera2Api={true}
      ratio={&quot;16:9&quot;}
  
  //to take a picture
      ref={ref =&gt; {
      this.camera = ref;
    }}
    &gt;
  </code></pre>
  <p>...</p>
  <pre><code> &lt;TouchableOpacity
          style={{
            alignSelf: 'flex-end',
            alignItems: 'center',
                backgroundColor: 'transparent',
              }}
              onPress={() =&gt; async () =&gt; {
    if (this.camera) {
      let photo = await this.camera.takePictureAsync();
    }}
        &gt;
          &lt;FontAwesome
            name=&quot;camera&quot;
            style={{ color: &quot;#fff&quot;, fontSize: 40 }}
          /&gt;
        &lt;/TouchableOpacity&gt;
  </code></pre>