I've been trying to figure out why renderFilteredList does not render these list items (both of them include the substring this.props.searchedWord and the console logs true, and renderFilteredList is called from the original render function).
{<li key={singleObject.body} className="list-group-item">{singleObject.body}</li>}
{<li key={singleObject.name} className="list-group-item">{singleObject.name}</li>}
and I couldn't figure out why, can anyone tell me what is wrong with my code please?
renderFilteredList(){
console.log('the data to fetch is: ', this.props.dataFetched, 'and the searchedWord is: ', this.props.searchedWord);
return this.props.dataFetched.map(objects=>{
return objects.map(singleObject=>{
console.log(singleObject.body.includes(this.props.searchedWord), singleObject.name.includes(this.props.searchedWord));
<div>
{<li key={singleObject.body} className="list-group-item">{singleObject.body}</li>}
{<li key={singleObject.name} className="list-group-item">{singleObject.name}</li>}
<hr/>
</div>
})
})