I'm trying to render a list as shown in the example but it assumes rendering a single element.
const list = [
{ key: 'a', value: '1' },
{ key: 'b', value: '2' }
];
const Example = () => new forgo.Component({
render() {
return list.map(item => [
<p>{item.key}</p>,
<p>{item.value}</p>
])
}
});
In React, you could wrap listed items like this into a fragment which you can attach a key to.
return list.map(item => [
<Fragment key={item.key}>
{[
<p>{item.key}</p>,
<p>{item.value}</p>
]}
</Fragment>
])
How would you do this in forgo?
I'm trying to render a list as shown in the example but it assumes rendering a single element.
In React, you could wrap listed items like this into a fragment which you can attach a key to.
How would you do this in forgo?