Prevent meta from crashing on SSR while this isn't implemented yet

This commit is contained in:
Greg Johnston 2022-09-25 22:11:00 -04:00
parent f9ff54249a
commit b4cef51f08

View file

@ -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);