Fix mounted event after initial hydration (#3480)
* trigger queued mounted events immediately after hydrating * add a playwright test to prevent regressions
This commit is contained in:
1 parent
d41ab3a756
commit
d890cc72ac
8 files changed
+76
-1
No files matched your search
@@ -125,6 +125,12 @@ pub async fn run(mut virtual_dom: VirtualDom, web_config: Config) -> ! {
|
||||
|
||||
let rx = websys_dom.rehydrate(&virtual_dom).unwrap();
|
||||
hydration_receiver = Some(rx);
|
||||
|
||||
#[cfg(feature = "mounted")]
|
||||
{
|
||||
// Flush any mounted events that were queued up while hydrating
|
||||
websys_dom.flush_queued_mounted_events();
|
||||
}
|
||||
}
|
||||
#[cfg(not(feature = "hydrate"))]
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user