Fix side-by-side fragments by walking in reverse (#2841)

* got a repro, but no solution :(

* hmmmmm 🤔

* awyayayayayayya

* omg it's because we dont create in rev

* Make nodes rev

* fix tests compile

* Clean up PR

* revert changes to native

* Clean up PR, add test
This commit is contained in:
Jonathan Kelley authored and GitHub committed 2024-08-14 19:38:54 +00:00
1 parent 851abe82d5
commit 2f30c73678
4 files changed
+184 -180

No files matched your search

@@ -97,14 +97,17 @@ impl WriteMutations for MutationState {
fn load_template(&mut self, template: Template, index: usize, id: dioxus_core::ElementId) {
// Get the template or create it if we haven't seen it before
let tmpl_id = self.templates.get(&template).cloned().unwrap_or_else(|| {
let current_max_template_count = self.templates.len() as u16;
let tmpl_id = self.templates.len() as u16;
self.templates.insert(template, tmpl_id);
for root in template.roots.iter() {
self.create_template_node(root);
self.templates.insert(template, current_max_template_count);
}
let id = template.roots.len() as u16;
self.channel.add_templates(current_max_template_count, id);
current_max_template_count
let len = template.roots.len() as u16;
self.channel.add_templates(tmpl_id, len);
tmpl_id
});
self.channel