小编Pet*_*er 的帖子

元素类型无效:应为字符串(对于内置组件)或类/函数(对于复合组件)但得到:对象。反应原生

所以我一直在做很多关于为什么这不起作用并且无法找到任何东西的研究。有谁知道这个错误与什么有关?

Error: 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 `App`.
    
    This error is located at:
        in App (created by ExpoRoot)
        in ExpoRoot
        in RCTView (created by View)
        in View (created by AppContainer)
        in RCTView (created by View)
        in View (created by AppContainer)
        in AppContainer
    - node_modules\expo\build\logs\LogSerialization.js:160:14 in _captureConsoleStackTrace
    - node_modules\expo\build\logs\LogSerialization.js:41:26 in serializeLogDataAsync
    - ... 9 more stack frames from framework internals
Run Code Online (Sandbox Code Playgroud)

这是我的App.js: …

javascript android npm react-native yarnpkg

1
推荐指数
1
解决办法
1347
查看次数

给定一个由 N 个介于(-100 和 100)之间的整数组成的数组 A Java

我正在练习 Java,我的教授给了我这个问题:

给定一个由 N 个整数(-100 到 100 之间)组成的数组 A,计算数组内所有元素的乘积,并根据输出返回 (-1, 0, 1)。

例如:

A[1,2,3] will return 1 because the output is (6), 
A[-1,2,3] will return -1 because the output is (-6), 
A[1,2,0] will return 0 because the output is (0)
Run Code Online (Sandbox Code Playgroud)

方法定义:

public static int solution(int[] A) {
}
Run Code Online (Sandbox Code Playgroud)

我的方法:我认为这将是一个递归过程,因为我将有多个输入。

处理一个块 A[1,2,3],将值 (1) 存储到 newArr[] 中,处理另一个块 A[-1,2,3],将值 (-1) 存储到 newArr[] 中,依此类推on... 最后返回 newArr[] 并其中包含正确的值。

到目前为止我所拥有的,现在我有点卡住了..

public static void main(String[] args) {
        // TODO Auto-generated method stub
         int arr[] = {6,-7,8,9};
         int …
Run Code Online (Sandbox Code Playgroud)

java arrays

0
推荐指数
1
解决办法
9650
查看次数

标签 统计

android ×1

arrays ×1

java ×1

javascript ×1

npm ×1

react-native ×1

yarnpkg ×1