Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stringification of dynamically generated array of partials #1

Closed
barelyhuman opened this issue Oct 24, 2023 · 0 comments · Fixed by #2
Closed

Stringification of dynamically generated array of partials #1

barelyhuman opened this issue Oct 24, 2023 · 0 comments · Fixed by #2
Assignees
Labels
bug Something isn't working

Comments

@barelyhuman
Copy link
Member

Doesn't stringify the output of the following

const tables = [1,2,3]

html`
    <div class="container">
      <div class="row">
        <div class="col">${() =>tables.map(x => html`<p>${x}</p>`)}</div>
      </div>
    </div>
  `

Workaround:

const tables = [1,2,3]
const tablesViews = state.tables.map(x => html`<p>${x}</p>`)

html`
    <div class="container">
      <div class="row">
        <div class="col">${tablesViews}</div>
      </div>
    </div>
  `
@barelyhuman barelyhuman added the bug Something isn't working label Oct 24, 2023
@barelyhuman barelyhuman self-assigned this Oct 24, 2023
@barelyhuman barelyhuman linked a pull request Oct 24, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant