diff --git a/README.md b/README.md index 9d5efc8..c6c12e0 100644 --- a/README.md +++ b/README.md @@ -59,8 +59,8 @@ impl Extension for HelloWorld { } async fn hello_world(request: HttpRequest) -> ResultPage { - Page::new(Some(request)) - .with_component(Html::with(move |_| html! { h1 { "Hello World!" } })) + Page::new(request) + .add_component(Html::with(move |_| html! { h1 { "Hello World!" } })) .render() } diff --git a/examples/hello-name.rs b/examples/hello-name.rs index 3a491a6..e1285d0 100644 --- a/examples/hello-name.rs +++ b/examples/hello-name.rs @@ -13,7 +13,7 @@ async fn hello_name( path: service::web::Path, ) -> ResultPage { let name = path.into_inner(); - Page::new(Some(request)) + Page::new(request) .add_component(Html::with(move |_| html! { h1 { "Hello " (name) "!" } })) .render() } diff --git a/examples/hello-world.rs b/examples/hello-world.rs index 5550514..d56f210 100644 --- a/examples/hello-world.rs +++ b/examples/hello-world.rs @@ -9,7 +9,7 @@ impl Extension for HelloWorld { } async fn hello_world(request: HttpRequest) -> ResultPage { - Page::new(Some(request)) + Page::new(request) .add_component(Html::with(move |_| html! { h1 { "Hello World!" } })) .render() } diff --git a/src/lib.rs b/src/lib.rs index e43da2f..93b8564 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -60,8 +60,8 @@ impl Extension for HelloWorld { } async fn hello_world(request: HttpRequest) -> ResultPage { - Page::new(Some(request)) - .with_component(Html::with(move |_| html! { h1 { "Hello World!" } })) + Page::new(request) + .add_component(Html::with(move |_| html! { h1 { "Hello World!" } })) .render() }