Hello guys, I’m really fresh on Meteor and I’m trying to retrieve some data from db and access it and display on React. I have a initial data that is loaded when Meteor.startup and then I’m trying to access it using withTracker and Subscribe. Here’s the project: https://github.com/fboechats/Pathable-Challenge
You need to add a
Meteor.publish call on your server side somewhere.
You’re subscribing in App.jsx, but that subscription isn’t defined anywhere.
That’s only if you truly need reactivity in your data client side. Otherwise, simply fetch them through a
Meteor.call / Meteor.methods
Here’s a very small template CRUD application designed to illustrate how Meteor and React work together:
There are links to several screencasts at the end that walk you through various aspects of the application.
I tried to publish it after a loaded my data, but still doesn’t work. Now it’s returning undefined instead of the empty array.
Try this sample of a basic chat React + Mongo. You can see how to publish and subscribe data sources https://github.com/massimosgrelli/meteor-react-chat-test