Jonathan Kelley 3 anni fa
parent
commit
c092bd4
1 ha cambiato i file con 2 aggiunte e 0 eliminazioni
  1. 2 0
      packages/hooks/src/usestate.rs

+ 2 - 0
packages/hooks/src/usestate.rs

@@ -61,6 +61,8 @@ pub fn use_state<'a, T: 'static>(
         }
         }
     });
     });
 
 
+    hook.current_val = hook.slot.borrow().clone();
+
     (hook.current_val.as_ref(), hook)
     (hook.current_val.as_ref(), hook)
 }
 }