forgojs / forgojs/forgo

Fragment usage

Open
#84 3 comments 0 reactions 1 assignee Claimed by @spiffytech View on GitHub
documentation enhancement medium-priority question
Dominant language
TypeScript
Stars
321
Forks
10
PR merge metrics
No merged PRs in 30d

Description

I'm trying to render a list [as shown in the example](https://github.com/forgojs/forgo#rendering-lists-and-using-keys) 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 => [

{item.key}

,

{item.value}


])
}
});
```

In React, you could wrap listed items like this into a fragment which you can attach a key to.

```
return list.map(item => [

{[

{item.key}

,

{item.value}


]}

])
```

How would you do this in forgo?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.