mirror of
https://github.com/leptos-rs/leptos
synced 2024-11-10 06:44:17 +00:00
docs: add missing provide_meta_context()
in example (#2311)
Otherwise user gets: ``` use_head() is being called without a MetaContext being provided. We'll automatically create and provide one, but if this is being called in a child route it may cause bugs. To be safe, you should provide_meta_context() somewhere in the root of the app. ```
This commit is contained in:
parent
98633c8700
commit
830fba794e
1 changed files with 3 additions and 0 deletions
|
@ -16,6 +16,9 @@
|
|||
//!
|
||||
//! #[component]
|
||||
//! fn MyApp() -> impl IntoView {
|
||||
//! // Provides a [`MetaContext`], if there is not already one provided.
|
||||
//! provide_meta_context();
|
||||
//!
|
||||
//! let (name, set_name) = create_signal("Alice".to_string());
|
||||
//!
|
||||
//! view! {
|
||||
|
|
Loading…
Reference in a new issue