DEV Community

Discussion on: error on rendering an array of items using redux

Collapse
 
vonheikemen profile image
Heiker • Edited

const {searchresults} = this.props.searchresults assumes that the shape of your object is:

{
  "searchresults": {
    "searchresults": [/* stuff */]
  }
}

I'm not sure that's the case. Did you try const {searchresults} = this.props;

It would help a lot with this type of questions if you could reproduce the error, put in codepen or stackblitz and share the link in your post.

Collapse
 
kenethsimon profile image
kennyLFC
Collapse
 
vonheikemen profile image
Heiker

The error message suggest that something you think is an array is actually an object and you are trying to render that. You may have to inspect everything in that render function in SearchBar. I would start with this.props.