Meteor findOne not returning value

I have a component that has a subscription to items.
The items are confirmed to be there as if I use the following it returns the cursor with the item inside it:

console.log(Items.find({key: itemKey}).fetch());

The items collection is imported etc.

My constructor:

            this.state = {
                    subscription: {
                            items: Meteor.subscribe("allItems")

my component will unmount method:


This is the methods where the issue lies. The error is Uncaught TypeError: Cannot read property ‘srcEntire’ of undefined:

           console.log(itemKey); // shows the correct key
           var itemer = Items.findOne({key: itemKey});
            return itemer.srcEntire;

The render section ( It shows the image if I hardcode the return value of the getItemSource method. The source of the image is found by calling the getItemSource method and passing in the layer prop that is passed in (props work):


     return (  								
              <div className="col-lg-3" >
             <img id="myLayer" className="on-top img-responsive center-block on-top " name="myLayer" src={this.getItemSource(this.props.layers.myLayer)} />



Is there any place you wait for the subscription to be ready?

No, is there a way to do this?

I would strongly recommend against subscribing in the constructor. Rather, wrap your component in a Meteor container and follow that pattern.

See here.