试图设置实际的propTypes。但要表现出这样的错误
试图导入错误:“FieldInputProps”不是从“react final-form”导出的。
import { FieldInputProps, FieldMetaState } from 'react-final-form';
const TextInput = ({
input: { name, onChange, value, type = 'text', placeholder, ...restInput },
meta
}) => {
.....Some Component Functionality.....
};
TextInput.propTypes = {
input: FieldInputProps,
meta: FieldMetaState
}不知道为什么会发生这种情况,怎么解决呢?
发布于 2020-12-29 15:23:09
检查您的反应-最终形式的package.json版本。我在这个沙箱中没有错误:https://codesandbox.io/s/epic-jennings-i32w6?file=/src/App.js,使用了6.5.2
https://stackoverflow.com/questions/65493953
复制相似问题