lustre-labs / lustre

A Gleam web framework for building HTML templates, single page applications, and real-time server components.
https://hexdocs.pm/lustre
MIT License
950 stars 65 forks source link

Custom element (component) is not swapped for another component #19

Closed Nicd closed 11 months ago

Nicd commented 11 months ago

Repro case: https://codesandbox.io/p/sandbox/strange-heisenberg-s449ny?file=%2Fsrc%2Fapp.gleam%3A46%2C16

First, comp-b should be rendered (as it is). When the counter is raised above 5, comp-a should be rendered instead, but it never is. If you set a breakpoint in createElement, you can see that comp-a is created, but it never appears in the DOM.

hayleigh-dot-dev commented 11 months ago

This was a silly bug where I had an important line of code above a curly brace instead of below it 🙃 Fixed in v3.0.9!