Function ambient_element::provide_context
source · pub fn provide_context<T: Clone + Debug + Send + Sync + 'static>(
hooks: &mut Hooks<'_>,
default_value: impl FnOnce() -> T
) -> Setter<T>
Expand description
Provide a value which is accessible to all children further down the tree.
Note: This hook does not rely on order, and is therefore safe to use inside conditionals.