Skip to content

Commit

Permalink
📌 Allows non-browser environments to run SSR.
Browse files Browse the repository at this point in the history
  • Loading branch information
langyo committed Jul 16, 2024
1 parent b0636da commit 007ba9a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions examples/web/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ impl DeclType for App {
type Routes = Routes;
type AppStates = AppStates;

fn decl_render_outside(props: &RoutesOutsideProps<Self::AppStates>) -> yew::Html {
fn decl_render_outside(props: &RoutesOutsideProps<Self::AppStates>) -> yew::HtmlResult {
let theme_raw = format!(
r#"
:root {{
Expand Down Expand Up @@ -114,14 +114,14 @@ impl DeclType for App {
props.states.small_text_size.to_owned(),
);

yew::html! {
Ok(yew::html! {
<>
<style>
{theme_raw}
</style>
<h1>{"Hikari DEMO"}</h1>
{props.children.clone()}
</>
}
})
}
}
8 changes: 4 additions & 4 deletions packages/boot/tests/register_routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ mod test {
type Routes = Routes;
type AppStates = AppStates;

fn decl_render_outside(props: &RoutesOutsideProps<Self::AppStates>) -> yew::Html {
yew::html! {
fn decl_render_outside(props: &RoutesOutsideProps<Self::AppStates>) -> yew::HtmlResult {
Ok(yew::html! {
<>
<h1>{"Hikari DEMO"}</h1>
{props.children.clone()}
</>
}
})
}
}

Expand All @@ -71,7 +71,7 @@ mod test {
color: "#114514".to_string(),
},
)
.await;
.await?;
println!("{}", html);

Ok(())
Expand Down

0 comments on commit 007ba9a

Please sign in to comment.