Hi, I’m using meteor with React Native and I’m encountering some issues with subscribing and getting data from my collection
Basically my current set up is I have 2 folders, one called App and one called Backend. App is the react native application and Backend is the meteor server and admin client.
In my meteor server I have a collection.js with the following:
import { Mongo } from 'meteor/mongo';
export const Tasks = new Mongo.Collection('tasks');
And my publish on the backend is:
import { Tasks } from '../imports/collections.js'
Meteor.publish("newTask", function () {
return Tasks.find();
});
Then in my react native app I have
export default withTracker((props) => {
return {
newTaskReady: Meteor.subscribe('newTask').ready(),
task: Tasks.find(),
};
})(Home);
Is it wise to Import Tasks from a collection that is in a complete separate folder on my desktop? Im getting errors when I try “…/…/App/imports/collections.js” saying it doesnt exist
Is there any other way of doing this than importing from a complete different folder? If not, how can I fix this
As far as I can tell the .ready() subcription works, its just the find() that doesnt
Could I just make a new collections.js and put it in the react native app, or it must be imported from the meteor app?