From 388e2acc7f7c3357007a8d50a75ced7ae3600f7e Mon Sep 17 00:00:00 2001
From: Greg Johnston
+
`, it shows: +```html +
+`. When the browser parses that `
`, then opens the `
`. + +As a result, our DOM tree no longer matches the expected view tree, and a hydration error ensues. + +Unfortunately, it is difficult to ensure the validity of HTML in the view at compile time using our current model, and without an effect on compile times across the board. For now, if you run into issues like this, consider running the HTML output through a validator. (In the case above, the W3C HTML Validator does in fact show an error!) + +```admonish info +You may notice some bugs of this arise when migrating from 0.6 to 0.7. This is due to a change in how hydration works. + +Leptos 0.1-0.6 used a method of hydration in which each HTML element was given a unique ID, which was then used to find it in the DOM by ID. Leptos 0.7 instead began walking over the DOM directly, hydrating each element as it came. This has much better performance characteristics (shorter, cleaner HTML output and faster hydration times) but is less resilient to the invalid or edge-case HTML examples above. Perhaps more importantly, this approach also fixes a number of *other* edge cases and bugs in hydration, making the framework more resilient on net. +``` + +#### `
"First" | +
"First" | +