1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
use Arc;
use ;
use Blueprint;
use crateHyleComponents;
/// Hyle configuration stored in Dioxus context.
///
/// Provide this at your root component:
/// ```rust,ignore
/// use_context_provider(|| HyleConfig { blueprint: Arc::new(my_blueprint()) });
/// ```
///
/// The blueprint is wrapped in `Arc` so that cloning the context value (which
/// Dioxus does on every `use_context` call) stays cheap.
/// Read the `HyleConfig` from Dioxus context.
///
/// Panics if `HyleConfig` has not been provided by an ancestor component.
pub
/// Read `HyleComponents` from Dioxus context, if provided.
///
/// Returns `None` when no ancestor has called
/// `use_context_provider(|| HyleComponents { .. })`.
/// Convenience re-export so callers don't need to import `use_context_provider` directly.
pub use use_context_provider;