【发布时间】:2021-06-30 09:56:58
【问题描述】:
我正在将我的 React Native 项目更新到最新版本。我也在使用打字稿。我正在复制很多旧代码,其中一个代码位是这样的
let groupSelected = this.props.screenProps.contactGroups[this.state.groupIndexSelected]
this.setState({
expandedContacts: [...this.state.expandedContacts, groupSelected],
})
groupSelected.GroupDropdownMenuChoices.forEach(choice => {
choice.selected = false
choice.selectedNotAll = false
})
我收到了这个错误
无法分配给对象“#”的只读属性“selected”
我可以在这里寻求帮助吗?
【问题讨论】:
标签: javascript typescript react-native