Answer the question
In order to leave comments, you need to log in
How to get status value from this.state.data?
constructor(props) {
super(props)
this.state = {
data : [
{
key: 1,
id: 1,
name: 'Иван Иванов',
status: true,
feedback: 'Отличная работа, буду всем советовать',
},
{
key: 2,
id: 2,
name: 'Петр Петров',
status: false,
feedback: 'Сделали круто, спасибо большое',
},
]
}
this.columns = [
{ title: 'id', dataIndex: 'id', key: 'id' },
{ title: 'Имя', dataIndex: 'name', key: 'name' },
{ title: 'Отзыв', dataIndex: 'feedback', key: 'feedback' },
{
title: 'Статус',
dataIndex: 'status',
key: 'status',
render: (record) =>
record.status // Проблема здесь
? <Tag color="success">Активен</Tag>
: <Tag color="default">Не активен</Tag>
},
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question