I am facing trouble with my code not rendering after it gets passed on data from a store.
I am able to console.log() the data coming from the store but the data is not displaying in the DOM.
Here is what my component looks like
var ItemList = React.createClass({
mixins: [Reflux.connect(SearchStore,"data")],
getItems() {
var items;
var self = this;
if(typeof self.state.data !== 'undefined' && self.state.data !== '404') {
items = self.state.data;
for(var key in items) {
if (items.hasOwnProperty(key)) {
items[key].map(function(obj, key){
return(
<h1>Test Test</h1>
);
})
}
}
} else {
return(<div></div>);
}
},
render() {
var self = this;
return (
<div id="search-results">
{self.getItems()}
</div>
);
}
});
export default ItemList;
The data comes in after it is passed, from the store and i can read the data and am able to render the empty div but the div with the text is not getting rendered at all. My intention is to take the data passed and pass them as props to another component.
Any help on getting this solved would be really great because I have been stuck at this for the last couple of hours.