mirror of
https://github.com/leptos-rs/leptos
synced 2024-11-10 14:54:16 +00:00
Prevent meta from crashing on SSR while this isn't implemented yet
This commit is contained in:
parent
f9ff54249a
commit
b4cef51f08
1 changed files with 13 additions and 0 deletions
|
@ -77,6 +77,19 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "ssr")]
|
||||
#[component]
|
||||
pub fn Title(cx: Scope, formatter: Option<Formatter>, text: Option<TextProp>) {
|
||||
let meta = use_head(cx);
|
||||
if let Some(formatter) = formatter {
|
||||
*meta.title.formatter.borrow_mut() = Some(formatter);
|
||||
}
|
||||
if let Some(text) = text {
|
||||
*meta.title.text.borrow_mut() = Some(text.into());
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "ssr"))]
|
||||
#[component]
|
||||
pub fn Title(cx: Scope, formatter: Option<Formatter>, text: Option<TextProp>) {
|
||||
let meta = use_head(cx);
|
||||
|
|
Loading…
Reference in a new issue