I have such an object
export const otherInformation = [
{
"FAQ": ['Getting started guide', 'Selling policy'],
"Help & Support": ['Help guide', 'Selling policy'],
"Legal": ['Terms of Use', 'Privacy Policy']
}]
My code
class Information extends Component {
render() {
const otherInformationLoop = otherInformation.map((value, key) => {
return (
<div>
<div className="col-md-4" key={key}>
<div className="dashboard-info">
{Object.keys(value).map((val, k) => {
return (<h4 k={k}>{val}</h4>)
})
}
</div>
</div>
</div>
)
})
return (
{ otherInformationLoop }
);
}
}
I am having trouble passing an object.
The resulting error looks like this:
Information.render(): A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object
How can I loop an object so that the result is obtained
Thanks in advance. Any help is appreciated.
Coeus source
share