【发布时间】:2019-11-12 04:41:45
【问题描述】:
我刚刚遇到一个 React-native 应用程序,它在 .js 文件中声明类型,如下所示:
this.notificationOpenedListener = firebase.notifications()
.onNotificationOpened((notificationOpen: NotificationOpen) => {
const notif: Notification = notificationOpen.notification;
notificationOpenedClickHandler(notif)
});
我检查了 package.json 文件并且没有 typescript 包。 Vscode lint 将(notificationOpen: NotificationOpen) 部分下划线为红色。
这里发生了什么?
【问题讨论】:
-
我不赞成这个问题收到的反对票。被包含针对其文件类型的无效语法的文件所混淆是完全合理的。
标签: javascript typescript flowtype google-closure-compiler