I am trying to Print a list but I am getting this error and I am not sure what is the problem. It's suggesting that I am returning null, but in my opinion I am returning listItems
, which you can see gets list passed from another component.
Full Error:
Featured.render(): A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object.
My Snippet:
import React, {Component} from 'react';
class Featured extends Component {
render() {
// const items = function (items) {
const listItems = this.props.items.map((items) =>
<div className="fh5co-block to-animate">
<div className="overlay-darker"></div>
<div className="overlay"></div>
<div className="fh5co-text">
<i className="fh5co-intro-icon icon-bulb"></i>
<h2>{items.toString()}</h2>
<p>Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there
live the blind texts.</p>
<p><a href="#" className="btn btn-primary">Get In Touch</a></p>
</div>
</div>
);
// }
return (
listItems
);
}
}
export default Featured;