Skip to content

Bug: <template> tag content rendered twice #4732

Description

@marvinhagemeister
  • 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions