import React from 'react';
import { StyleSheet, View } from 'react-native';
import { FlatList, Text } from "react-native";
import { useState } from 'react';
import Header from './components/header';
export default function App() {
const [todos, setTodos] = useState([
{ task: 'Angular tanulás', id: '1' },
{ task: 'ReactNative tanulás', id: '2' },
{ task: 'Tisztkód tanulás', id: '3' },
{ task: 'JavaFX tanulás', id: '4' },
]);
const renderItem = ({item}) => (
<View stlye={styles.item}>
<Text style={styles.task}>{item.task}</Text>
</View>
);
return (
<View style={styles.container}>
<Header />
<FlatList
data={todos}
renderItem={renderItem}
keyExtractor={item => item.task}
/>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
task: {
fontSize: 22,
},
});