react-native 报错记录

Warning: Failed child context type: Invalid child context virtualizedCell.cellKey of type number supplied to CellRenderer, expected string. #18291

keyExtractor={(item, index) => index.toString()}                         

加个toString()

在调用相机或相册的时候,报错Error: Missing camera or camera roll permission.

expo =>27.0.1

  • 解决方法:把授权相机和相册都调一遍
showCamera = async () => {
        const { status } = await Permissions.askAsync(Permissions.CAMERA);
        const cameraRollPermission = await Permissions.askAsync(Permissions.CAMERA_ROLL);
        if (status === 'granted' && cameraRollPermission.status) {
            let result = await ImagePicker.launchCameraAsync({
                allowsEditing: true,
                aspect: [4, 3],
            });
            let file = { uri: result.uri, type: 'multipart/form-data', name: 'image.jpg' };
            if (!result.cancelled) {
               ......
            }
        }
    }

在安卓上 overFlow:hidden 需要加个zIndex:-1

Module @babel/runtime/helpers/interopRequireDefault does not exist in the Haste module map

-解决方法:

npm install --save-dev @babel/core
npm install --save-dev @babel/runtime
npm add @babel/runtime
npm install
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 7,458评论 0 10
  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 135,026评论 19 139
  • "Unterminated string literal.": "未终止的字符串文本。", "Identifier...
    两个心阅读 8,469评论 0 4
  • 借用经济权威人士--中央财经办主任刘鹤的观点,未来中国经济既不是U形,也不是V形而是L形。无论什么行,说明中国模式...
    stoneonly阅读 185评论 0 0
  • 我常常问他,永远有多远?他说,永远就是我和你的距离。可是,我觉得在时光渐渐的逃离中,我和他的距离变得越来越远,直至...
    润寒阅读 352评论 0 3