this.state.records.filter(record => this.state.id == '' || record.id.includes(this.state.id))
.map(record=> (
<ProjectItem key={record.id} project={record} />
))
当我这样做时,我得到 TypeError: record.id.includes is not a function,includes is String func 但我的 record.id 无法识别
constructor(props){
super(props)
this.state={
records:[],
id:''
};
我正在从 axios.get() 获取记录 []