首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法导入FieldInputProps react最终形式

无法导入FieldInputProps react最终形式
EN

Stack Overflow用户
提问于 2020-12-29 14:42:37
回答 1查看 190关注 0票数 0

试图设置实际的propTypes。但要表现出这样的错误

试图导入错误:“FieldInputProps”不是从“react final-form”导出的。

代码语言:javascript
复制
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
}

不知道为什么会发生这种情况,怎么解决呢?

EN

回答 1

Stack Overflow用户

发布于 2020-12-29 15:23:09

检查您的反应-最终形式的package.json版本。我在这个沙箱中没有错误:https://codesandbox.io/s/epic-jennings-i32w6?file=/src/App.js,使用了6.5.2

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65493953

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档