I am working with an object
type MyType = 'name' | 'base' | 'six';
obj: MyType = {
'name': {key: 'm1'},
'base': {key: 'm2'},
'six': {key: 'm3'},
}
My goal is to loop through obj and generate a LIST of elements like this:
<div>name,m1</div><div>base,m2</div><div>six,m3</div>
I attempted using reduce or map for this, but it didn't work as expected. This is the desired output.
Object.entries(obj).reduce((acc, key) => {return <div>key,item[key]</div>};