Rename modules to use snake_case (#1498)

This commit is contained in:
Leonard authored and GitHub committed 2023-09-26 17:20:29 -05:00
1 parent 31780b3ede
commit a2dd926f7f
13 files changed
+18 -18

No files matched your search

+9
View File
@@ -0,0 +1,9 @@
use dioxus_core::ScopeState;
///
pub fn use_root_context<T: 'static + Clone>(cx: &ScopeState, new: impl FnOnce() -> T) -> &T {
cx.use_hook(|| {
cx.consume_context::<T>()
.unwrap_or_else(|| cx.provide_root_context(new()))
})
}