Bläddra i källkod

Fix hydration race condition (#3240)

* Fix mount_to_root

* Remove WebsysDom.mount
Ryo Hirayama 7 månader sedan
förälder
incheckning
e1457744f0
3 ändrade filer med 0 tillägg och 10 borttagningar
  1. 0 3
      packages/interpreter/src/unified_bindings.rs
  2. 0 4
      packages/web/src/dom.rs
  3. 0 3
      packages/web/src/lib.rs

+ 0 - 3
packages/interpreter/src/unified_bindings.rs

@@ -44,9 +44,6 @@ mod js {
     #[extends(BaseInterpreter)]
     pub struct Interpreter;
 
-    fn mount_to_root() {
-        "{this.appendChildren(this.root, this.stack.length-1);}"
-    }
     fn push_root(root: u32) {
         "{this.pushRoot(this.nodes[$root$]);}"
     }

+ 0 - 4
packages/web/src/dom.rs

@@ -134,10 +134,6 @@ impl WebsysDom {
             suspense_hydration_ids: Default::default(),
         }
     }
-
-    pub fn mount(&mut self) {
-        self.interpreter.mount_to_root();
-    }
 }
 
 fn walk_event_for_id(event: &web_sys::Event) -> Option<(ElementId, web_sys::Element)> {

+ 0 - 3
packages/web/src/lib.rs

@@ -121,9 +121,6 @@ pub async fn run(mut virtual_dom: VirtualDom, web_config: Config) -> ! {
         websys_dom.flush_edits();
     }
 
-    // the mutations come back with nothing - we need to actually mount them
-    websys_dom.mount();
-
     loop {
         // if virtual dom has nothing, wait for it to have something before requesting idle time
         // if there is work then this future resolves immediately.