Код: Выделить всё
import { FlatList } from 'react-native';
import posts from '~/assets/data/posts.json';
import PostListItem from '~/src/components/PostListItem';
export default function FeedScreen() {
return (
}
contentContainerStyle={{ gap: 10, maxWidth: 512, width: '100%' }}
showsVerticalScrollIndicator={false}
/>
);
}
PostListItem выглядит так:
Код: Выделить всё
import { View, Image, Text } from 'react-native';
import { Ionicons, Feather, AntDesign } from '@expo/vector-icons';
export default function PostListItem({ post }) {
return (
{/* Header */}
{post.user.username}
{/* Icons */}
);
}
Код: Выделить всё
}
contentContainerStyle={{
gap: 10,
maxWidth: 512,
width: '100%',
alignItems: 'center'
}}
showsVerticalScrollIndicator={false}
/>
Подробнее здесь: https://stackoverflow.com/questions/790 ... ontentcont
Мобильная версия