fix outlets being updated out of order

This commit is contained in:
Evan Almloff committed 2023-05-23 12:59:31 -05:00
1 parent f94dc85491
commit 46017d5b7e
3 files changed
+36 -10

No files matched your search

+4 -1
View File
@@ -8,7 +8,10 @@ pub(crate) struct OutletContext {
}
pub(crate) fn use_outlet_context(cx: &ScopeState) -> &OutletContext {
let outlet_context = use_context(cx).unwrap();
let outlet_context = cx.use_hook(|| {
cx.consume_context()
.unwrap_or(OutletContext { current_level: 0 })
});
outlet_context
}