Skip to content

TypeError: null is not an object (evaluating 'RNDocumentPicker.pick') #358

Closed

Description

@dotku

Here is my full code, I got error with TypeError, null is not an object?!
Why?

import React from "react";
import { View } from "react-native";
import { Button, IconButton, TextInput } from "react-native-paper";
import DocumentPicker from "react-native-document-picker";

export default function PostAdd() {
  const selectFile = () => {
    DocumentPicker.pick({
      type: [DocumentPicker.types.allFiles],
    }).then((res) => {
      console.log("res : " + JSON.stringify(res));
    });
  };

  return (
    <View>
      <TextInput
        multiline
        numberOfLines={5}
        placeholder="What's on your mind?"
      />
      <IconButton icon="camera" onPress={selectFile} />
      <Button>Post</Button>
    </View>
  );
}

Activity

  1. mandrewsan commented on Nov 14, 2020

    @mandrewsan

    On iOS, running pod install in ios directory fixed this for me.

  2. label-actions commented on Dec 25, 2020

    @label-actions

    👋 @dotku, sorry you're having an issue. This issue is being closed because it does not provide all information required by the issue template.
    As the issue template explains, we require that you provide a runnable example that reproduces your issue and your environment information. This means you need to provide a git repository with code that reproduces the issue.
    The reason is that maintainers do not have time to try reproduce bugs themselves. Please try to minimize the superfluous code and focus only on reproducing the bug.
    Please create a new issue with this and we'll be happy to review it!

  3. locked and limited conversation to collaborators on Dec 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions