Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
dotku opened this issue Nov 5, 2020 · 2 comments
Closed

Comments

@dotku
Copy link

dotku commented Nov 5, 2020

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>
  );
}

@mandrewsan
Copy link

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

@label-actions
Copy link

label-actions bot commented Dec 25, 2020

👋 @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!

@label-actions label-actions bot closed this as completed Dec 25, 2020
@label-actions label-actions bot locked and limited conversation to collaborators Dec 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants