fix incremental router cache
This commit is contained in:
1 parent
d94316f7dd
commit
73a45fb113
2 files changed
+11
-4
No files matched your search
@@ -12,9 +12,7 @@ where
|
|||||||
use dioxus_router::prelude::RouterConfig;
|
use dioxus_router::prelude::RouterConfig;
|
||||||
|
|
||||||
#[cfg(feature = "ssr")]
|
#[cfg(feature = "ssr")]
|
||||||
let context: crate::prelude::DioxusServerContext = cx
|
let context = crate::prelude::server_context();
|
||||||
.consume_context()
|
|
||||||
.expect("RouteWithCfg should be served by dioxus fullstack");
|
|
||||||
|
|
||||||
let cfg = *cx.props;
|
let cfg = *cx.props;
|
||||||
render! {
|
render! {
|
||||||
|
|||||||
@@ -42,7 +42,16 @@ where
|
|||||||
if is_static {
|
if is_static {
|
||||||
match Rt::from_str(&full_path) {
|
match Rt::from_str(&full_path) {
|
||||||
Ok(route) => {
|
Ok(route) => {
|
||||||
render_route(renderer, route, &mut tokio::io::sink(), |_| {}, wrapper).await?;
|
render_route(
|
||||||
|
renderer,
|
||||||
|
route,
|
||||||
|
&mut tokio::io::sink(),
|
||||||
|
|vdom| {
|
||||||
|
let _ = vdom.rebuild();
|
||||||
|
},
|
||||||
|
wrapper,
|
||||||
|
)
|
||||||
|
.await?;
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
log::info!("@ route: {}", full_path);
|
log::info!("@ route: {}", full_path);
|
||||||
|
|||||||
Reference in new issue
Block a user