Reactjs,Typescript 错误TS2322:类型{} 不可分配给类型“IntrinsicAttributes & IntrinsicClassAttributes”

时间:2021-07-14 09:24:28

标签: javascript reactjs typescript jenkins error-handling

大家好,我有一些打字稿错误的问题,你能帮我找个时间弄清楚吗?错误行标有 //->>// (........................................ ………………………………………………………………………………………………………………………………………………………… ………………………………………………………………………………………………………………………………………………………… ………………………………………………………………………………………………………………………………………………………… .) -->IMAGE from JENKINS <--

这是我的代码

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>
        );
    }
}

0 个答案:

没有答案