Meteor.call returns undefined withTracker


#1

I am using withTracker to create a (reactive) prop for my Component, but it’s undefined.

export default withTracker( (props) ->
  console.log("withTracker", props)
  itemsCompleted:  Meteor.call("itemCountCompletedByUser", props.items)) (Component)

The props show up and the server call works as I log on the terminal the result.

Inside the render function, I try to display via {this.props.itemsCompleted}, but it’s undefined. I thought the prop would re-render on return of the Meteor.call, but it appears I’m missing something.


#2

Whoever told you that would work was misinformed.

Try the React Tutorial to see the proper ways to interact with the server


#3

I’ll take a look, thanks.