react-native-google-signin-无法读取未定义的属性'number'

时间:2019-01-17 12:24:57

标签: javascript react-native google-signin

当我实施时 import { GoogleSignin } from 'react-native-google-signin';

我收到此错误:Cannot read property 'number' of undefined

我已删除 node_modules ,并再次安装了所有依赖项,但再次出现相同的错误。

2 个答案:

答案 0 :(得分:0)

检查反应本机版本,如doc

  

如果您将React Native      

如果您将React Native

遵循安装指南:AndroidiOS

还要检查this问题

答案 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