So I get items from a DB and console.log them just before, so I know they exist and are in the format I want them to be. I also wrote a simple method to make sure rendering works. The code looks something like this (is simplified for nonrelevantbits)
const renderSomething = () => {
getFromDB().then(function(data){
if (data) {
console.log(data.something) //returns an array in console
return data.something.map(somet => {
console.log(' somet is ' + somet) //return somet with quotes: ""
return <p>{somet}</p>
})
} else {
console.log("No data!");
}
}
}
and then in the return:
return (
<div>
{renderSomething()}
</div>
)
And nothing appears on the screen. I made a test one to make sure it should:
const basic = () => {
return ['abc', 'bca'].map(num => <h1>{num}</h1>)
}
return (
<div>
{basic()}
</div>
)
The test one worked