I want to get all the content and print them all in the same way. I can get everything but images.
componentDidMount(){ this.fetchPosts().then(this.setPosts); } fetchPosts = () => this.client.getEntries() setPosts = response => { this.setState({ posts: response.items }) } render(){ return( <p>{console.log(this.state)}</p> <Brands /> { this.state.posts.map(({fields}, i) => <BoardItem key={i} {...fields} /> )} ) }
}
const BoardItem = (props) => (
<div>
<img src={props.brandLogo} alt=’’/>
<p>{props.brandName}</p>
</div>
)
solved by adding this line. <img src={props.brandLogo.fields.file.url + ‘?w=200&h=200’} alt=’’/>