小编Hem*_*sda的帖子

[未处理的承诺拒绝:TypeError:null不是对象(评估'_reactNativeImageCropPicker.default.openPicker')]

我正在通过博览会运行我的反应本机应用程序。 React-native-image-picker 也发生了同样的事情。

我尝试使用react-native link react-native-image-pickerreact-native link react-native-image-crop-picker。它不起作用,所以我尝试取消链接并再次链接,但仍然不起作用。我尝试了各种方法,也尝试了不同版本的react-native和react-native-image-picker以及react-native-image-crop-picker。

链接到 npm 库:-

图像选择器-> https://www.npmjs.com/package/react-native-image-crop-picker/v/0.4.2

image-crop-picker -> https://github.com/react-native-community/react-native-image-picker

React-native-image-picker 的代码:-

import ImagePicker from 'react-native-image-picker';

// More info on all the options is below in the API Reference... just some common use cases shown here
const options = {
  title: 'Select Avatar',
  customButtons: [{ name: 'fb', title: 'Choose Photo from Facebook' }],
  storageOptions: {
    skipBackup: true,
    path: 'images',
  },
};

/**
 * The first arg is the options object …
Run Code Online (Sandbox Code Playgroud)

javascript react-native react-native-image-picker

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