AntDesign表未呈现新值

时间:2018-08-31 04:50:28

标签: reactjs antd

我的页面结构

Main Page - (Data is Fetch from server)
- Employee Page - (Data is then appended via file upload)
  - Employee Page Detail - (Receives data from props)

员工页面构造器

constructor(props){
        super(props);
        this.state = {
            testDataSource: props.data,
            dataSource: props.data,
        }
    }

呈现员工页面详细信息

<FormItem>
     {getFieldDecorator('employeeDetail', {
           rules: [{required: true, message: 'Detail cannot be empty'}],
           initialValue: dataSource.employeeDetail
     })(
           <EmployeeDetailPage form={form} />
     )}
</FormItem>

Employee Page Detail构造器

constructor(props) {
        super(props);
        this.state = {
            value: props.value
        }
    }

然后呈现表格

<Table columns={columns} dataSource={value} />

我尝试在Employee Page Detail上打印该值,并对其进行了更新,但是以某种方式我的表未显示最新值。我想知道这种方法有什么问题。

谢谢!

1 个答案:

答案 0 :(得分:0)

您是说表的数据是通过Employee Page传递的吗?如果是这样,请尝试将props.value更改为this.props.value