改变鼻息状态数组

问题描述 投票:-1回答:1

我想更改状态数组中的状态,我该怎么做

 this.state = {
  education_record: [
    {
      institute: '',
      degree_title: '',
      start_date: '',
      end_date: '',
      summery: '',
    },
  ],
};


        value={this.state.education_record}
          onChangeText={value =>
            this.setState({
              education_record: {
                ...this.state.education_record,
                start_date: value,
              },
            })
          }

当我输入er时,新数组如下所示0:{机构:“”,学位标题:“”,开始日期:“”,结束日期:“”,夏季:“”}研究所:“ er”

arrays react-native state
1个回答
0
投票

尝试像这样使用扩展运算符:

© www.soinside.com 2019 - 2024. All rights reserved.