0
我正在尝试使用typescript 2.3创建一个形式的redux-form 6.6.3并作出反应。我已经安装了类型定义@ types/redux-form 6.6.2。这里是形式:使用typescript的redux-form生成异常:''Property'createFunction'在类型'JSX.IntrinsicElements'上不存在'''
import * as React from 'react';
import { reduxForm, Field } from 'redux-form';
import styles from '../../styles/styles';
class CreateFunction extends React.Component < any, any > {
private required = (value) => (value == null ? 'required' : undefined);
private handleSubmit =() =>{}
public render() {
return (
<div style={{ marginTop: 30 }}>
<form onSubmit={this.handleSubmit}>
<Field name="name" component="input"
hintText="Veuillez saisir la fonction"
floatingLabelText="Fonction"
style={styles.textField}
validate={this.required}
/>
</form>
</div>
);
}
}
const createFunction = reduxForm({
form: 'createFunctionForm',
})(CreateFunction);
export default createFunction;
但一旦进口这样的CreateFunction:
import createFunction from '../../functions/containers/functiolList';
和使用这样的:
<createFunction />
我不能构建和我有这个错误消息:
severity: 'Error'
message: 'Property 'createFunction' does not exist on type 'JSX.IntrinsicElements'.'
at: '66,9'
source: 'ts'
谢谢!你真的帮助我。 – bonheury