Смотрите скриншот
Мой код:< /p>
`
экспортировать функцию по умолчанию Home() {
Код: Выделить всё
const [data, setData] = useState(
[
{
"id": 1,
"label": "This is the label for item 1.\nIt continues on the second line."
},
{
"id": 2,
"label": "This is the label for item 2.\nIt continues on the second line."
},
{
"id": 3,
"label": "This is the label for item 3.\nIt goes to the second line\nand even a third line."
},
{
"id": 4,
"label": "This is the label for item 4.\nSecond line."
},
{
"id": 5,
"label": "This is the label for item 5.\nSecond line\nThird line."
},
{
"id": 6,
"label": "This is the label for item 6.\nAnother second line."
},
{
"id": 7,
"label": "This is the label for item 7.\nSecond line, third line."
},
{
"id": 8,
"label": "This is the label for item 8.\nSecond line."
},
{
"id": 9,
"label": "This is the label for item 9.\nAnother second line."
},
{
"id": 10,
"label": "This is the label for item 10.\nAnd it continues\nonto a third line."
}
]
);
return (
setNotes(text)}
/>
handleAdd()} />
{notes.length > 0 && handleCancel()} />}
{data.length > 0 && item.id}
style={styles.messageListContainer}
initialNumToRender={data.length}
renderItem={(item) => (
[
setIdSaver(item.item.id),
handleEdit(item.item.label)]}>
{item.item.label}
handleRemove(item.item.id)} />
)}
ItemSeparatorComponent={() => }>
}
)
conststyles = StyleSheet.create({
screenContainer: {
padding: 10,
rowGap: 20
},
messageContainer: {
marginTop: 30,
},
messageList: {
paddingVertical: 10,
flexShrink : 1,
ширина: "100%"
},
messageListContainer: {
},
ввод: {
maxHeight: 100,
backgroundColor: "lightgrey"
},
listingContainer: {
display: "flex",
flexDirection: "row",
justifyContent: "space-between" ,
alignItems: "center",
пробел: 10,
},
сообщение: {
цвет: "черный",
},
/>разделитель: {
backgroundColor: «lightgrey»,
height: 1,
},
actionContainer: {
rowGap: 5,
},
})
`
Подробнее здесь: https://stackoverflow.com/questions/790 ... ot-visible