当我实施时
import { GoogleSignin } from 'react-native-google-signin';
我收到此错误:Cannot read property 'number' of undefined
我已删除 node_modules ,并再次安装了所有依赖项,但再次出现相同的错误。
答案 0 :(得分:0)
答案 1 :(得分:0)
反应已更新,不包含const data = [
['Apple', 'Orange', 'Banana', 'Pears', 'Peach'],
[40, 35, 25, 58, 84],
[2, 4, 4, 3, 1, 2],
['Red', 'Yellow', 'Green', 'Violet', 'Blue']
];
let mapIdxToProp = new Map([[0, "name"],[1, "price"],[2, "quantity"],[3, "color"]]);
let minLen = Math.min(...data.map(x => x.length));
let res = data.reduce((acc, arr, idx) =>
{
arr.forEach((x, j) =>
{
(j < minLen) && (acc[j] = acc[j] || {}, acc[j][mapIdxToProp.get(idx)] = x);
});
return acc;
}, []);
console.log(res);
。将propTypes
中的import语句替换为以下导入:
GoogleSignIn.ios.js