What is 检查 `WithContext` 的渲染方法。错误

问题描述 投票:0回答:1

我正面临这个错误。 错误说

 got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
 throw Error( "Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " + (type == null ? type : typeof type) + "." + info );

但是,该组件被声明为导出并正确定义。

未捕获的错误:元素类型无效:需要一个字符串(对于内置组件)或一个类/函数(对于复合组件)但得到:未定义。您可能忘记从定义它的文件中导出您的组件,或者您可能混淆了默认导入和命名导入。

检查

WithContext
.

的渲染方法

const ProfileUpdate = (props) => {}


const mapDispatchToProps = (dispatch) => {
  return {
    profileUpdate: (user) => dispatch(profileUpdate(user)),
  };
};


export default connect(mapStateToProps, mapDispatchToProps)(ProfileUpdate);

完整版↓ https://www.dropbox.com/s/yubscdktmeikbqi/ProfileUpdate.js

reactjs
1个回答
0
投票

我有同样的问题。将

react-tag-input
的版本降级为
6.4.1
帮助了我(在此之前,版本是
^6.7.3
)。 我在 https://github.com/react-tags/react-tags/issues/573

上找到了这个解决方案
© www.soinside.com 2019 - 2024. All rights reserved.