title: camera.takePictureAsync(options) is not a function in react native camera
body: <p>Hello im new in react native and i just building my first react native project with camera without expo.
  I installed it with <code>npm install react-native-camera</code> and then linked it with <code>react-native link react-native-camera</code>. 
  The camera run successfuly,  but when i triggered the snap button it got error like this....</p>
  
  <blockquote>
    <p>{ [TypeError: camera.takePictureAsync is not a function. (In 'camera.takePictureAsync(options)', 'camera.takePictureAsync' is undefined)]
                                 │ line: 131480,
                                 │ column: 72,
                                 └ sourceURL: '<a href="http://localhost:8081/index.bundle?platform=android&amp;dev=true&amp;minify=false" rel="nofollow noreferrer">http://localhost:8081/index.bundle?platform=android&amp;dev=true&amp;minify=false</a>' }</p>
  </blockquote>
  
  <p>Here is my code looks like...</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import React, { useRef } from 'react'
  import { View, Text, StyleSheet, TouchableOpacity } from 'react-native'
  import { RNCamera } from 'react-native-camera'
  
  
  function PlayWithCamera() {
  
      const camera = useRef(null)
  
      const takePicture = async () =&gt; {
          try {
              const options = { quality: 0.5, base64: true };
              const data = await camera.takePictureAsync(options);
              console.log(data.uri, '&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;');
          } catch (error) {
              console.log(error, "ERROR &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;")
          }
      };
  
      return (
          &lt;View style={styles.container}&gt;
              &lt;RNCamera
                  ref={camera}
                  style={styles.preview}
                  type={RNCamera.Constants.Type.back}
                  flashMode={RNCamera.Constants.FlashMode.on}
                  androidCameraPermissionOptions={{
                      title: 'Permission to use camera',
                      message: 'We need your permission to use your camera',
                      buttonPositive: 'Ok',
                      buttonNegative: 'Cancel'
                  }}
                  androidRecordAudioPermissionOptions={{
                      title: 'Permission to use audio recording',
                      message: 'We need your permission to use your audio',
                      buttonPositive: 'Ok',
                      buttonNegative: 'Cancel',
                  }}
                  onGoogleVisionBarcodesDetected={({ barcodes }) =&gt; {
                      console.log(barcodes)
                  }}
              /&gt;
              &lt;View style={{ flex: 1, width: '100%', flexDirection: 'row', justifyContent: 'center', position: 'absolute', bottom: 0 }}&gt;
                  &lt;TouchableOpacity style={styles.capture} onPress={takePicture}&gt;
                      &lt;Text style={{ fontSize: 14 }}&gt; SNAP &lt;/Text&gt;
                  &lt;/TouchableOpacity&gt;
              &lt;/View&gt;
          &lt;/View&gt;
      )
  }
  
  const styles = StyleSheet.create({
      container: {
          flex: 1,
          flexDirection: 'column',
          backgroundColor: 'black',
      },
      preview: {
          flex: 1,
          justifyContent: 'flex-end',
          alignItems: 'center',
      },
      capture: {
          flex: 0,
          backgroundColor: '#fff',
          borderRadius: 5,
          padding: 15,
          paddingHorizontal: 20,
          alignSelf: 'center',
          margin: 20,
      },
  })
  
  export default PlayWithCamera</code></pre>
  </div>
  </div>
  </p>
  
  <p>UPDATE (18.48):
  I tried using class component like in <code>react-native-camera</code> documentation did, and it finally works. But i still curious how to make it works in function component?</p>