First steps into React – and trying to iterate through an (existing) collection. The subscription seems to work fine, but I can’t find out how to render “metadata.tags”. It seems that the map function is having trouble with the data.
In Blaze this was pretty straight forward … but maybe I’m missing the obvious. Thanks for any help!
Error:
Uncaught TypeError: this.getMeteorData(...).map is not a function
Don’t try to call the getMeteorData() function directly. Instead update it to return an object with a reference to your docTags values, then reference these values using this.data.docTags. For example:
Change let docTags = {}; to let docTags = [];. Right now when the handle.ready() check is false you’re returning an object for the docTags value, which doesn’t have a map function.