Im curious on how to iterate through an array and append the results to a react component. Ive gotten the part of sorting through an array of objects and grabbing the accounts that I want. Now im unsure of how to go about appending them to html.
export default class SortedTeams extends React.Component {
renderContent(content){
var entries = [{fullname: 'foo', title: 'designer'}, {fullname:
'foo2',
title: 'designer'}, {fullname: 'foo3', title: 'developer'}]
var nohit = [];
for(var i = 0; i <= entries.length - 1; i++) {
if(entries[i].title === 'designer'){
console.log('foohit');
}
else{
nohit.push('nope')
}
}
render() {
var content = this.props.block.content;
return(
<SiteBuilderBlock tag="section" className="sortedTeams" block={this.props.block}>
<div>
<SiteBuilderList tag="div" list="teams" inGroupsOf={4} inGroupsOfClassName="row">
{(element, key) => this.renderContent(element, key)}
</SiteBuilderList>
</div>
</SiteBuilderBlock>
);
}
}