javascript - React-native 在导入语句上抛出意外的 token 错误

标签 javascript android firebase react-native

React-native 在 firebase 导入语句中抛出意外标记。我已经尝试解决这个问题很长时间了。我已经使用 npm i install @react-native-firebase/auth 安装了 @react-native-firebase/auth。请帮忙。 这是错误截图: enter image description here

最佳答案

这很可能发生,因为您无法像在代码中那样导入。

正如文档所述 import :

The export parameters specify individual named exports, while the import * as name syntax imports all of them. Below are examples to clarify the syntax.

如果您需要从库中导出的所有对象,则需要在其中放置一个别名,如下所示:

import * as auth from '@react-native-firebase/auth';

希望对您有所帮助!

关于javascript - React-native 在导入语句上抛出意外的 token 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59908741/

相关文章:

javascript - 使用 DOH 测试自定义模块

android - AppWidgetHostView 无法处理任何触摸/点击事件?

android - 在特定点绘制旋转路径

facebook - Facebook 的 Firebase 身份验证错误

javascript - 选择文件时自动提交上传表单,并触发操作

javascript - Jquery 函数 css

android - 如何从 java 代码访问 android 默认图像(例如,按下时搜索栏拇指的图像)?

ios - getInitialLink 上的 Firebase 动态链接仅在 IOS 和生产链接(React Native)上为空

swift - self.userUid = user.user.uid 方法在 Swift 中仍然不起作用

javascript - 单击按钮时的表单数据