Skip to content

Commit

Permalink
fix: Use leptos_routes in leptos example instead of `leptos_routes_…
Browse files Browse the repository at this point in the history
…with_context` (#322)

Using `leptos_routes_with_context` to provide the state as a context is
redundant and can cause errors.
  • Loading branch information
spencewenski authored Aug 10, 2024
1 parent 4ea1083 commit 054e161
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions examples/leptos-ssr/src/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::server::fileserv::file_and_error_handler;
use anyhow::anyhow;
use async_trait::async_trait;
use axum::Router;
use leptos::{get_configuration, provide_context};
use leptos::get_configuration;
use leptos_axum::{generate_route_list, LeptosRoutes};
use migration::Migrator;
use roadster::app::context::AppContext;
Expand Down Expand Up @@ -67,12 +67,7 @@ impl RoadsterApp<AppState> for Server {
.register_builder(
HttpService::builder(Some(BASE), &state.clone()).router(
Router::<AppState>::new()
.leptos_routes_with_context(
&state.clone(),
routes,
move || provide_context(state.clone()),
App,
)
.leptos_routes(&state, routes, App)
.fallback(file_and_error_handler),
),
)
Expand Down

0 comments on commit 054e161

Please sign in to comment.