소스 검색

Fix context type in static generation crate (#2607)

Evan Almloff 11 달 전
부모
커밋
f07ab370b9
2개의 변경된 파일2개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 2
      packages/fullstack/src/launch.rs
  2. 1 1
      packages/static-generation/src/launch.rs

+ 1 - 2
packages/fullstack/src/launch.rs

@@ -116,8 +116,6 @@ async fn launch_server(
 ) {
     use clap::Parser;
 
-    use crate::prelude::RenderHandleState;
-
     let args = dioxus_cli_config::ServeArguments::from_cli()
         .unwrap_or_else(dioxus_cli_config::ServeArguments::parse);
     let addr = args
@@ -129,6 +127,7 @@ async fn launch_server(
     #[cfg(feature = "axum")]
     {
         use crate::axum_adapter::DioxusRouterExt;
+        use crate::prelude::RenderHandleState;
 
         let router = axum::Router::new().register_server_functions_with_context(context_providers);
         #[cfg(not(any(feature = "desktop", feature = "mobile")))]

+ 1 - 1
packages/static-generation/src/launch.rs

@@ -10,7 +10,7 @@ pub use crate::Config;
 #[allow(unused)]
 pub fn launch(
     root: fn() -> Element,
-    contexts: Vec<Box<dyn Fn() -> Box<dyn Any> + Send + Sync>>,
+    contexts: Vec<Box<dyn Fn() -> Box<dyn Any + Send + Sync> + Send + Sync>>,
     platform_config: Config,
 ) {
     let virtual_dom_factory = move || {