fix constructing no argument components

This commit is contained in:
Evan Almloff committed 2024-01-11 11:44:18 -06:00
1 parent 1794debf79
commit bcbb647d02
5 files changed
+40 -23

No files matched your search

+2 -2
View File
@@ -102,8 +102,8 @@ pub fn once<State: Clone + 'static>(initializer: impl FnOnce() -> State) -> Stat
/// Get the current render since the inception of this component
///
/// This can be used as a helpful diagnostic when debugging hooks/renders, etc
pub fn generation() -> Option<usize> {
with_current_scope(|cx| Some(cx.generation())).expect("to be in a dioxus runtime")
pub fn generation() -> usize {
with_current_scope(|cx| cx.generation()).expect("to be in a dioxus runtime")
}
/// Get the parent of the current scope if it exists