首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我不能在react-typescript项目中使用javascript导入

我不能在react-typescript项目中使用javascript导入
EN

Stack Overflow用户
提问于 2019-06-20 11:13:56
回答 1查看 96关注 0票数 1

我正在尝试添加一个firebase的谷歌登录功能。我正在使用react钩子和typescript。我似乎不能使用StyledFirebaseAuth模块。当我试图渲染它时,它给出了这个错误

代码语言:javascript
复制
JSX element type 'StyledFirebaseAuth' is not a constructor function for JSX elements.
  Type 'StyledFirebaseAuth' is missing the following properties from type 'ElementClass': render, context, setState, forceUpdate, and 3 more.

我已尝试检查我的tsconfig是否有任何可能导致此问题的设置

这是我的导入

import StyledFirebaseAuth from 'react-firebaseui/StyledFirebaseAuth';

当我尝试渲染时

代码语言:javascript
复制
<StyledFirebaseAuth
 uiConfig={uiConfig}
 firebaseAuth={firebase.auth()}
 />

我得到了这个错误

代码语言:javascript
复制
JSX element type 'StyledFirebaseAuth' is not a constructor function for JSX elements.
  Type 'StyledFirebaseAuth' is missing the following properties from type 'ElementClass': render, context, setState, forceUpdate, and 3 more.
EN

回答 1

Stack Overflow用户

发布于 2019-06-20 12:44:12

我想明白了,谢谢。我所要做的就是删除我的包-lock.json

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

https://stackoverflow.com/questions/56678464

复制
相关文章

相似问题

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