inProgress-team / inProgress-team/react-native-meteor

undefined is not a function (evaluating '_reactNativeMeteor2.default.collection("messages").find().fetch()')

Open
#172 14 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
688
Forks
200
PR merge metrics
No merged PRs in 30d

Description

In my Meteor app I have a collection definition like this:

```
this.collections.Messages = new Mongo.Collection("messages");
```
Now I try to connect to it from a react native meteor like this:

```
import React, { Component } from 'react';
import Meteor, { createContainer } from 'react-native-meteor';
import MessageListComponent from '../routes/messageList';

export default MessageListContainer = createContainer(() => {
const messagesHandle = Meteor.subscribe('userMessage');
const loading = !messagesHandle.ready();
const messages = Meteor.collection("messages").find().fetch();
return {
loading,
messages
};
}, MessageListComponent);

```

But it's return below red error message on device:
```
undefined is not a function (evaluating '_reactNativeMeteor2.default.collection("messages").find().fetch()')
```

What is the problem guys?

**/CC:** @Mokto
**/CC:** @noris666

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.