reactjs - 我不能在我的 react-typescript 项目中使用 javascript 导入
问题描述
我正在尝试使用 firebase 添加谷歌登录功能。我正在使用反应钩子和打字稿。我似乎无法使用该StyledFirebaseAuth
模块。当我尝试渲染它时,它给出了这个错误
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';
当我尝试渲染时
<StyledFirebaseAuth
uiConfig={uiConfig}
firebaseAuth={firebase.auth()}
/>
我得到这个错误
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.
解决方案
我想通了谢谢。我所要做的就是删除我的 package-lock.json
推荐阅读
- algorithm - 需要有关千鸟模式形成算法的建议
- c++ - 输出提供整数的大小而不是实际的整数
- reactjs - 如何在 Redux 中通过 React 钩子正确使用 GET 请求?
- google-apps-script - 使用 appscript 在 Gmail 中批量发送带有相应附件的电子邮件
- reactjs - 从 django 到 django rest 框架:电子商务与 react
- python - 在 Windows 上安装 tensorflow 的问题
- c# - 如何在循环中更改颜色和清除标签?
- multicore - 使用尖峰模拟器的 RISC-V 多核应用
- reactjs - 是否可以在 React 中使用“无限滚动”?
- javascript - 添加新数据时如何将 prev.data 保存在 localStorage 中?