TypeError: undefined is not an object (evaluating '_reactNativeImagePicker.default.showImagePicker') code example

Example: [Fri Apr 16 2021 12:41:49.460] ERROR TypeError: undefined is not an object (evaluating '_reactNativeImagePicker.default.showImagePicker')

import * as ImagePicker from "react-native-image-picker"


                <Button onPress={() =>
                        ImagePicker.launchImageLibrary(
                          {
                            mediaType: 'photo',
                            includeBase64: false,
                            maxHeight: 200,
                            maxWidth: 200,
                          },
                          (response) => {
                            console.log(response);
                            this.setState({resourcePath: response});
                          },
                        )
                      }
                title="Select Image"/>

Tags:

Misc Example