resultList = (function() {
return (
<div className="item" key={1}>
<p>No results!</p>
</div>
)
});
Why are you setting a function? Just set the <div... –
resultList = (
<div className="item">
<p>No results!</p>
</div>
)
Edit –
In order to really use a function (not sure why, though), the code would have to be a bit different –
const Foo = (function() {
return (
<div className="item" key={1}>
<p>No results!</p>
</div>
)
});
resultList = (<Foo />)
Edit 2 –
The above edit works because React components do not have to be constructors/classes, they can also be a simple function that gets props as a parameter and returns JSX. I think this type of components is a bit limited, but it works.