title: TypeError: undefined is not a function (near '...data.map...')
body: <p>I updated my code thanks to your help. 
  When I launch the app with Expo, the opening works but I lost my scan icon which does not appear in my screen. 
  This icon appeared previously.
  The idea is to scan some barcodes in order to display relevant data stemming from products.</p>
  
  <p>Here is my new code: </p>
  
  <pre><code>import React, { useState, useEffect } from "react";
  import {
    StyleSheet,
    Text,
    View,
    FlatList,
    Button,
    AsyncStorage,
  } from "react-native";
  import { useNavigation } from "@react-navigation/core";
  import { TouchableOpacity } from "react-native-gesture-handler";
  import { FontAwesome5 } from "@expo/vector-icons";
  import { MaterialCommunityIcons } from "@expo/vector-icons";
  import { ActivityIndicator } from "react-native-paper";
  
  function ProductsScreen() {
    const navigation = useNavigation();
    const [data, setData] = useState([]);
    const [isLoading, setisLoading] = useState(true);
  
    useEffect(() =&gt; {
      const fetchData = async () =&gt; {
        const data = await AsyncStorage.getItem("userData");
  
        setData(data);
        setisLoading(false);
      };
      fetchData();
    }, []);
  
    console.log(data);
    return isLoading ? (
      &lt;ActivityIndicator /&gt;
    ) : (
      &lt;&gt;
        {data ? (
          &lt;FlatList
            data={dataArray}
            keyExtractor={(item) =&gt; item.name}
            renderItem={({ item }) =&gt; (
              &lt;&gt;
                &lt;Text&gt;{item.brand}&lt;/Text&gt;
  
                &lt;View style={styles.scan}&gt;
                  &lt;MaterialCommunityIcons
                    name="barcode-scan"
                    size={40}
                    color="black"
                    onPress={() =&gt; {
                      navigation.navigate("CameraScreen");
                    }}
                  /&gt;
                &lt;/View&gt;
              &lt;/&gt;
            )}
          /&gt;
        ) : null}
      &lt;/&gt;
    );
  }
  export default ProductsScreen;
  </code></pre>
  
  <p>I would appreciate your comments please.</p>