我不明白为什么我的代码无法在其他设备上运行,而我的代码在旧设备中被检查为正常。这是通知:
Invariant Violation: Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. Check the render method of `SceneView`.
This error is located at:
in SceneView (created by StackViewLayout)
in RCTView (created by View)
in View (created by AnimatedComponent)
in AnimatedComponent (created by Card)
in Card (created by Container)
in Container (created by StackViewLayout)
in RCTView (created by View)
in View (created by StackViewLayout)
in RCTView (created by View)
in View (created by StackViewLayout)
in StackViewLayout (created by withOrientation)
in withOrientation (created by Transitioner)
in RCTView (created by View)
in View (created by Transitioner)
in Transitioner (created by StackView)
in StackView (created by Navigator)
in Navigator (created by KeyboardAwareNavigator)
in KeyboardAwareNavigator (created by NavigationContainer)
in NavigationContainer (created by App)
in RCTView (created by View)
in View (created by App)
in App (created by ExpoRootComponent)
in RootErrorBoundary (created by ExpoRootComponent)
in ExpoRootComponent
in RCTView (created by View)
in View (created by AppContainer)
in RCTView (created by View)
in View (created by AppContainer)
in AppContainer
This error is located at:
in NavigationContainer (created by App)
in RCTView (created by View)
in View (created by App)
in App (created by ExpoRootComponent)
in RootErrorBoundary (created by ExpoRootComponent)
in ExpoRootComponent
in RCTView (created by View)
in View (created by AppContainer)
in RCTView (created by View)
in View (created by AppContainer)
in AppContainer
在我的代码app.js中。屏幕和视图的方法还可以。那我该怎么办?
答案 0 :(得分:0)
不确定我的问题,但是以错误的方式导入模块时出现类似的错误,下面是错误的:
从'/modules/my-module.js'导入{myDefault};
现在是正确的:
从'/modules/my-module.js'导入myDefault;