Skip to content

Bug: <template> tag content rendered twice #4732

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

Open
1 task done
marvinhagemeister opened this issue Mar 17, 2025 · 0 comments
Open
1 task done

Bug: <template> tag content rendered twice #4732

marvinhagemeister opened this issue Mar 17, 2025 · 0 comments

Comments

@marvinhagemeister
Copy link
Member

marvinhagemeister commented Mar 17, 2025

  • Check if updating to the latest Preact version resolves the issue

Describe the bug
Template tag content is rendered twice. My guess is that the oldDom pointer is wrong somewhere when recursing into <template> tags.

EDIT: Looks like the actual dom is stuck in excessiveDomChildren

To Reproduce

it('should hydrate <template> tags ', () => {
  function App() {
    return <template><h1>it works</h1></template>
  }

  scratch.innerHTML = `<template><h1>it works</h1></template>`

  render(<App />, scratch);

  expect(scratch.innerHTML).to.equal(`<template><h1>it works</h1></template>`)
});

Expected behavior
No duplicate content.

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

No branches or pull requests

1 participant