美文网首页
react-native 报错记录

react-native 报错记录

作者: clark124 | 来源:发表于2018-08-23 14:07 被阅读0次

    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
    

    相关文章

      网友评论

          本文标题:react-native 报错记录

          本文链接:https://www.haomeiwen.com/subject/yjopiftx.html