首页 > 解决方案 > react-native expo 问题:`SceneView` 的检查方法

问题描述

我不明白为什么我的代码不能运行其他设备,而我的代码在我的旧设备中检查正常。这是通知:

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 中。Screens and View 方法没问题。那么我必须做什么?

标签: react-nativeexpo

解决方案


不确定我的问题,但是当我以错误的方式导入模块时出现类似的错误,以下是错误的:

从'/modules/my-module.js'导入{myDefault};

现在是正确的:

从'/modules/my-module.js'导入myDefault;


推荐阅读