I yould like use server-render package on my Meteor App, using React and React-Router v4. But, onPageLoad event return an error :
Error running template: TypeError: Meteor.subscribe is not a function
It's on the createContainer function :
export default createContainer(() => {
const postsHandle = Meteor.subscribe('post');
const loading = !postsHandle.ready();
const postsList = Post.find({ 'draft': false }).fetch();
const listExists = !loading && !!postsList;
return {
loading,
listExists,
posts: listExists ? postsList : [],
};
}, PostList);
I don't understand how i can get Meteor.subscribe on null if i'm on the server.
Anyone have idea about my problem ?
Thank you community !