fix: namespacing of dynamic attributes

This commit is contained in:
Jonathan Kelley committed 2022-12-07 15:11:51 -08:00
1 parent db5b65b6cb
commit 0bf4725639
9 files changed
+24 -31

No files matched your search

+2
View File
@@ -1,6 +1,8 @@
use dioxus_core::ScopeState;
/// Consume some context in the tree, providing a sharable handle to the value
///
/// Does not regenerate the value if the value is changed at the parent.
pub fn use_context<T: 'static + Clone>(cx: &ScopeState) -> Option<&T> {
cx.use_hook(|| cx.consume_context::<T>()).as_ref()
}