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

fix: mapped precompile children #324

Merged
merged 1 commit into from
Nov 13, 2023
Merged

Conversation

marvinhagemeister
Copy link
Member

@marvinhagemeister marvinhagemeister commented Nov 13, 2023

This fixes an issue with Deno's new JSX precompile transform. The child expressions can also contain an Array in situations like this:

<ul>
  {[1,2,3].map(x => <li key={x}>{x}</li>)}
  <li>4</li>
</ul>

...which is transformed to something lie this:

const tpl = [
  "<ul>", "<li>4</li></ul>"
]

jsxTemplate(tpl, jsxEscape([1,2,3].map(x => ...)))

This case wasn't considered during rendering.

Copy link

changeset-bot bot commented Nov 13, 2023

🦋 Changeset detected

Latest commit: 6bf321d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
preact-render-to-string Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@marvinhagemeister marvinhagemeister merged commit 5570d10 into main Nov 13, 2023
1 check passed
@marvinhagemeister marvinhagemeister deleted the mapped-precompile-children branch November 13, 2023 12:10
@github-actions github-actions bot mentioned this pull request Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants