React Native Intercom - 不变违规
React Native Intercom - Invariant Violation
我正在使用 react-native-intercom 在我的应用程序中管理对讲机。我已经使用 CocoaPods 安装了 Intercom iOS SDK,并且 link 手动编辑了 react-native-intercom(使用 react-native link 时无效)。问题是当我将它插入容器时,加载时出现错误消息:
Invariant Violation: Element type is invalid: expected a string (for
built-in component) or a class/function (for composite components) but
got: object.
但是,如果我随后消除该错误,Intercom 会正常显示,例如如果我有:
componentWillMount () {
Intercom.displayConversationsList()
}
然后在消除错误后,我的消息会出现并且它会工作,所以我猜安装和 linking 没问题。我试过进行干净的 npm 安装,但同样的事情发生了,如果没有错误就无法加载。
我的渲染看起来像这样,因为我只是在空白页面上测试它:
render () {
return (
<View>
<Intercom />
</View>
)
}
我实际上只是假设这就是您在渲染中调用 Intercom 的方式,因为我找不到任何示例。
只需删除 <Intercom />
组件。
我正在使用 react-native-intercom 在我的应用程序中管理对讲机。我已经使用 CocoaPods 安装了 Intercom iOS SDK,并且 link 手动编辑了 react-native-intercom(使用 react-native link 时无效)。问题是当我将它插入容器时,加载时出现错误消息:
Invariant Violation: Element type is invalid: expected a string (for built-in component) or a class/function (for composite components) but got: object.
但是,如果我随后消除该错误,Intercom 会正常显示,例如如果我有:
componentWillMount () {
Intercom.displayConversationsList()
}
然后在消除错误后,我的消息会出现并且它会工作,所以我猜安装和 linking 没问题。我试过进行干净的 npm 安装,但同样的事情发生了,如果没有错误就无法加载。
我的渲染看起来像这样,因为我只是在空白页面上测试它:
render () {
return (
<View>
<Intercom />
</View>
)
}
我实际上只是假设这就是您在渲染中调用 Intercom 的方式,因为我找不到任何示例。
只需删除 <Intercom />
组件。