Files
dioxus/docs/guide/examples/hooks_composed.rs
T
Jon Kelley 540e785d8b Less clumsy configuration for desktop and mobile (#553)
* chore: dont use prebuilt builder pattern for configuring desktop

* chore: use regular config pattern for web

* Chore: update docs too

* chore: clean up some warnings
2022-09-13 16:22:27 -07:00

14 lines
272 B
Rust

#![allow(unused)]
use dioxus::prelude::*;
fn main() {}
struct AppSettings {}
// ANCHOR: wrap_context
fn use_settings(cx: &ScopeState) -> UseSharedState<AppSettings> {
use_context::<AppSettings>(cx).expect("App settings not provided")
}
// ANCHOR_END: wrap_context