ReactNative Flatlist - RenderItem not working : <p>So I'm trying to use React Native's FlatList renderItem property, but something very strange is happening.</p>

<p>The <code>data</code> property is set to an array which has elements which are not undefined, but then, in the <code>renderItem</code> function, it gives me an error saying that the argument of the function is undefined, unless I call the argument <code>item</code>.</p>

<p>Here's my code:</p>

<pre><code>export default class Profile extends React.Component {
    onLearnMore = (user) =&gt; {
        this.props.navigation.navigate('UserDetail', user)
    }

    render() {
        return (
            &lt;List&gt;
                &lt;FlatList
                    data={data.users}
                    renderItem={( {item} ) =&gt; {
                        console.log(item)
                        return (&lt;ListItem
                            roundAvatar
                            title={`${item.fName} ${item.lName}`}
                            onPress={() =&gt; this.onLearnMore(item)}
                        /&gt;)
                    }}
                /&gt;
            &lt;/List&gt;
        )
    }
}
</code></pre>

<p>If I swapped <code>{item}</code> with <code>{userData}</code>, then <code>userData</code> would be undefined later in the function. Does anyone know why this happens?</p>
