Skip to content

Render expression for every loop cycle #1

@VincentDamour

Description

@VincentDamour

The problem

Hi, first of all, thanks for this awesome tool.
I'm trying to render expression for each cycle of a loop, but only the last execution is rendered;

For this example, the output will be New post

const posts = [  { id: '1', text: 'Hello world!' },  { id: '2', text: 'New post' } ];

for (let post of posts) {
  <p>{post.text}</p>
}

Currently I need to use the map function to output each value, like this:

<p>
  { posts.map(post => <p key={post.id}>{post.text}</p>) }
</p>

Here an easier example, the output will be 10:

for (let i = 0; i <= 10; i++) {
  i
}

It would be great if the expression can be outputted for every loop cycle.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions