javascript - Reactjs,Typescript 错误 TS2322:类型 {} 不可分配给类型“IntrinsicAttributes & IntrinsicClassAttributes”
问题描述
嗨,伙计们,我遇到了某种打字稿错误的问题,你能找个时间给我买个答案吗?错误行标有 //->>// (..................... ..................................................... ..................................................... ..................................................... . ) -->来自詹金斯的图片<--
这是我的代码
render() {
return (
<CS.ModalWrapper onClick={e => e.stopPropagation()}>
<S.Legend>Add notification</S.Legend>
<S.InputSection>
<S.Header>Type</S.Header>
<S.SelectWrapper>
<Select
//This line ->// options={notificationTypes.map(value => ({ value, label: value }))}
onChange={element => element && this.handleChange(element, 'notification')}
/>
</S.SelectWrapper>
</S.InputSection>
<S.InputSection>
<S.Header>Days</S.Header>
<S.SelectWrapper>
<Select
//This line ->// isMulti
options={daysOfWeek.map((value, index) => ({
value: `${index}`,
label: value,
}))}
onChange={options => options && this.handleChange(options, 'selectedDays')}
/>
</S.SelectWrapper>
</S.InputSection>
<S.InputSection>
<S.Header>Hours</S.Header>
<S.SelectWrapper>
<Select
//This line ->// isMulti
options={getRange(24).map(val => ({
value: `${val}`,
label: formatNumberToHours(val),
}))}
onChange={options => options && this.handleChange(options, 'selectedHours')}
/>
</S.SelectWrapper>
</S.InputSection>
<CS.ButtonsWrapper>
<CS.Button onClick={this.props.closeForm}>Cancel</CS.Button>
<CS.Button onClick={this.handleSubmit}>Submit</CS.Button>
</CS.ButtonsWrapper>
<S.ErrorMessage>{this.state.error}</S.ErrorMessage>
</CS.ModalWrapper>
);
}
}
解决方案
推荐阅读
- react-native - React Native android 应用程序在应用商店上传时引发网络错误
- python - 在python中从月-年生成月的最后一天
- python - 如何组合一维数组以创建一个新数组
- swift - 如何在 SwiftUI 中隐藏导航返回按钮?
- c# - 具有不同派生类型属性的 C# 派生类
- python - Yolo v3 模型输出澄清与 keras
- algorithm - 跨组选择联合的下限
- tcp - GCP 中有没有办法对在不同区域的 GKE 中运行的 sftp 服务进行负载均衡?
- rpa - 在 Automation Anywhere 中动态初始化数组值的最佳方法是什么?
- postgresql - PostgreSQL 上的 Liquibase dropDefaultValue 映射到“SET DEFAULT”而不是“DROP DEFAULT”