Hard
Consider the following code:
import React from 'react'
import { View, Text, FlatList } from 'react-native'
const titles = [
{ title: 'title 1', key: 'i1' },
{ title: 'title 2', key: 'i2' },
...
]
const _keyExtractor = (item, index) => item.key
const ListComponent1 = () => (
<View>
{titles.map(item => <Text key={item.key}>{item.title})}
</View>
)
const ListComponent2 = () => (
<FlatList
data={titles}
keyExtractor={_keyExtractor}
renderItem={({item}) => <Text title={item.title} />}
/>
)
What are the true statements?
Author: Victor SabatierStatus: PublishedQuestion passed 457 times
Edit
0
Community EvaluationsNo one has reviewed this question yet, be the first!
Similar QuestionsMore questions about React Native
5
Write a React Native animation that spins an image.2
How to use StyleSheet in React Native1
What is the output of the following code?
const App = () => {
const [count, setCount] = useState(0);
return ({
<Text>
The count is {count}
</Text>
<Button onPress={() => setCount(count + 1)}>
Increase
</Button>
});
};
export default App;
1
Which of the following code snippets will print 'Hello World' to the console?1
I can launch the debugger in Chrome from my app, I run `react-native log-ios` from my command line